Question 1
Which of the following is NOT true about interfaces?
Can contain default methods
Can contain constructors
Can be implemented by multiple classes
Can contain static methods
Question 2
What is the main difference between class and interface?
Class can’t have variables
Interface can be instantiated
Interface can’t have method bodies (pre Java 8)
Class has only abstract methods
Question 3
Which Java feature allows multiple inheritance of type?
Interface
Abstract class
Inheritance
Static block
Question 4
Which annotation is used to declare a functional interface?
@Functional
@Interface
@Override
@FunctionalInterface
Question 6
Which of the following is a valid functional interface in Java?
Comparator
Runnable
Callable
All of the above
There are 6 questions to complete.