GkSeries.com

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

(1) Math class belongs to the package
[A] java.math
[B] java.lang
[C] java.util
[D] none of these

Comment

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

Comment

Answer: Option [C]

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

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

Comment

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

Comment

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

Comment

Answer: Option [B]

Please share this page

Chapters

Click Here to Read more questions

Teacher Eligibility Test