are the staements true or false? An Interface, say IName1 can be \'extended\' (I
ID: 3592537 • Letter: A
Question
are the staements true or false?
Explanation / Answer
Answer 8: True
Becuase interface is the collection of abstract methods, so classes which implement those interfaces need to implement all of the methods decarations of the interfaces.
Answer 9: True
Prior to java 8, we can have only method declarations in the interface, so the classes implementing those interface need to implement all methods declared in the interfaces, that's why we can not extend the interfaces, because every time we need to change the all classes implementing that interfaces. But from java 8, we can have default methods and static methods in the interfaces, and when a class will implement interface , it is not mandatory to provide the implementation for default methods of the interface.
Answer 10. True
Yes, class can call the default method by using super keyword.
Answer 11. True
As we know java supports multiple inheritance, that is a class can implement more than one interface, and each interface can define default method with same method signature, therefore, the inherited methods can conflict each other. In order to fix this class, we need to provide default method implementation.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.