Mcq On Java Interfaces

1. Which of these keywords is used to define interfaces in Java?

A. interface
B. Interface
C. intf
D. Intf

View Answer


2. A java interface can contain _______.

A. Abstract methods(unimplemented) and implemented methods both
B. public Abstract methods
C. public static Final Variables only
D. public static Final Variables and abstract methods both

View Answer


3. Which of these access specifiers can be used for an interface?

A. Public
B. private
C. Protected
D. All of the mentioned

View Answer


4. Which of the following is a correct interface?

A. abstract interface A { abstract void print(); { }}
B. abstract interface A { print(); }
C. interface A { void print() { } }
D. interface A { void print(); }

View Answer


5. Which of the following classes directly implement Set interface?

A. Vector
B. HashSet
C. HashTable
D. LinkedList

View Answer







Also check :


Discussion


* You must be logged in to add comment.