11.
In Java, can an interface have private methods with implementations?

12.
What is the result of the following code snippet?

interface MyInterface {
void myMethod();
}
public class MyClass implements MyInterface {
public void myMethod() {
System.out.println("Implementation");
}
public static void main(String[] args) {
MyInterface obj = new MyClass();
obj.myMethod();
}
}

13.
In Java, can an abstract class extend another class?

15.
In Java, can an interface extend another interface?

16.
What is the result of the following code snippet?

abstract class MyAbstract {
abstract void myMethod();
}
class MyClass extends MyAbstract {
void myMethod() {
System.out.println("Implementation");
}
public static void main(String[] args) {
MyAbstract obj = new MyClass();
obj.myMethod();
}
}

17.
In Java, can an abstract class have non-abstract methods?

18.
What is the purpose of the "default" keyword in Java interfaces?

19.
What is the result of the following code snippet?

interface MyInterface {
default void myMethod() {
System.out.println("Default Implementation");
}
}
class MyClass implements MyInterface {
public static void main(String[] args) {
MyInterface obj = new MyClass();
obj.myMethod();
}
}

20.
In Java, can a class implement an interface and extend an abstract class simultaneously?

Read More Section(Interfaces and Abstract Classes)

Each Section contains maximum 100 MCQs question on Interfaces and Abstract Classes. To get more questions visit other sections.