Page 1 of 1

About Question enthuware.ocpjp.v8.3.1479 :

Posted: Mon Aug 29, 2016 4:34 am
by ramy6_1
Hello ,
Regarding option 1 , why you considered interfaces to be always abstract ?
Currently with java 8 , they could have a default method which is non-abstract methods so interfaces behalves current with implementation.

Kindly clarify.

Re: About Question enthuware.ocpjp.v8.3.1479 :

Posted: Mon Aug 29, 2016 9:13 pm
by admin
Yes, an interface may have default and static methods. But that doesn't mean it is not abstract. You still can't instantiate an interface precisely because it is abstract.

You can think of it like an abstract class that has some methods implemented. Just because an abstract class has some method implementations doesn't mean it is not abstract anymore.

HTH,
Paul.

Re: About Question enthuware.ocpjp.v8.3.1479 :

Posted: Tue Aug 30, 2016 3:29 am
by ramy6_1
Thanks for your answer.

Re: About Question enthuware.ocpjp.v8.3.1479 :

Posted: Fri Aug 24, 2018 12:20 pm
by bsbravo
According to this Oracle's page https://docs.oracle.com/javase/tutorial ... tance.html :

"Default methods introduce one form of multiple inheritance of implementation. A class can implement more than one interface, which can contain default methods that have the same name. The Java compiler provides some rules to determine which default method a particular class uses."

So, wouldn't it make option D correct?

Re: About Question enthuware.ocpjp.v8.3.1479 :

Posted: Fri Aug 24, 2018 9:06 pm
by admin
You are right. It it indeed one form of multiple implementation inheritance. The only thing that is not allowed is multiple inheritance of the same method. Fixed.
thank you for your feedback!
Paul.