--:--









Quiz for Default & Static Methods in Interfaces

Course: JAVA | Subject: Java | Topic: Java 8 Features



Logo

Q1: What keyword is used to define a default method in an interface?

Logo

Q2: Can default methods be overridden in implementing classes?

Logo

Q3: What happens if two interfaces have same default method?

Logo

Q4: Which of these can call a static method in an interface?

Logo

Q5: Are default methods allowed in abstract classes?

Logo

Q6: Can static methods in interfaces be inherited?

Logo

Q7: Which of these is a benefit of default methods?

Logo

Q8: Which method is used to override a default method?

Logo

Q9: Can a default method access private fields of a class?

Logo

Q10: Which of these is NOT allowed in interfaces from Java 8?

Logo

Q11: What access modifier is used for default methods?

Logo

Q12: Which Java version introduced static methods in interfaces?

Logo

Q13: Can interfaces have private methods in Java 8?

Logo

Q14: Can default method call a static method from the same interface?

Logo

Q15: What is the output of calling an unimplemented default method?

Logo

Q16: Default methods are mainly introduced to:

Logo

Q17: A static method in an interface is:

Logo

Q18: What happens if class implements two interfaces with same default method?

Logo

Q19: Which keyword is NOT used with default methods?

Logo

Q20: Which is a correct example of a default method?

Are you ready to start test? Set your time limit