Packages and Interfaces - Objective Type Questions with Answers on Core Java

Sports GK Questions and Answers 2024 (Latest Updated)

Awards & Honours GK Questions 2024 (Latest Updated)

Questions
1 Math class belongs to the package
A java.math
B java.lang
C java.util
D none of these

Answer: Option [B]

java.lang package contain math class. This class contain basic methods to perform mathematical operations.

2 What class must be extended by all event classes?
A java.util.EventListener
B java.awt.AWTEvent
C java.util.EventObject
D java.awt.event.InputEvent

Answer: Option [C]

java.awt, java.awt.event and java.beans uses the class java.util.EventObject

Advertisement
Article and Schedule Quiz Start Test!
DOWNLOAD CURRENT AFFAIRS PDF FROM APP
3 What is the name of the Collection interface used to represent elements in a sequence?
A Collection
B Set
C List
D Map

Answer: Option [C]

The List is a collection interface which permits duplicates and represent elements in a particular order.

4 Which of the following statement is false?
A Variables declared inside of interface declaration may be changed by implementing class
B Interfaces are designed to support dynamic method resolution at run time
C When an interface method is implemented it must be declared as public
D Variables declaration are implicitly final

Answer: Option [A]

Java interface variables are static and final. They cannot be changed.

5 Which of the following classes directly implement Set interface?
A Vector
B HashSet
C LinkedList
D HashTable

Answer: Option [B]

Random GK Questions

Take Mock Tests

Missiles Mock Test Start Test!
SSC MTS Mock Test Start Test
IBPS CLERK MOCK TEST Start Test
SSC MTS 2022 JULY 26 Shift 1 (ENGLISH) Start Test!
SSC GD Previous Year Paper 2021 Nov 17 Shift - I (Hindi) Start Test!
SSC CGL Tier - 1 PYP 2022 April 21 Shift- 1 (ENGLISH) Start Test!
MPSC PAPER I MOCK TEST 1 (ENGLISH) Start Test!
IB Security Assistant Mock test 1 (english) Start Test!
UP POLICE CONSTABLE MOCK TEST 1 Start Test!
DELHI POLICE CONSTABLE MOCK TEST 1 (HINDI) Start Test!

Chapters

Assam Direct Recruitment Test Series

Computer Science Topics