About Question enthuware.ocpjp.v8.3.1479 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
ramy6_1
Posts: 124
Joined: Wed Feb 12, 2014 2:44 am
Contact:

About Question enthuware.ocpjp.v8.3.1479 :

Post 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.

Online
admin
Site Admin
Posts: 10061
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.
If you like our products and services, please help us by posting your review here.

ramy6_1
Posts: 124
Joined: Wed Feb 12, 2014 2:44 am
Contact:

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

Post by ramy6_1 »

Thanks for your answer.

bsbravo
Posts: 1
Joined: Wed Dec 04, 2013 3:12 pm
Contact:

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

Post 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?

Online
admin
Site Admin
Posts: 10061
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 66 guests