enthuware.ocajp.i.v7.2.903

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
ada.hao5
Posts: 1
Joined: Sat Jun 07, 2014 6:03 am
Contact:

enthuware.ocajp.i.v7.2.903

Post by ada.hao5 »

K is a valid interface because an interface is permitted to extend another interface.
When interface K intends J, doesn't K need to override all the methods in J? When overriding the method getJ(), is it allowed to modify the method parameter?

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

Re: enthuware.ocajp.i.v7.2.903

Post by admin »

No, an interface doesn't implement anything so there is no question of overriding.
If you change the method parameters, then it is not overriding anyway. It is overloading.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

edburgess2
Posts: 1
Joined: Sun Feb 09, 2014 6:53 pm
Contact:

Re: enthuware.ocajp.i.v7.2.903

Post by edburgess2 »

I answered that "It will fail to compile because of MyIJ"
which is defined as :

abstract class MyIJ implements J , I { }

When I enter that definition in Eclipse, I get the error message that an Abstract class cannot have a body.

Why isn't this the correct answer?

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

Re: enthuware.ocajp.i.v7.2.903

Post by admin »

Can't really comment on what Eclipse (or any other IDE) says and does. Please try it on command line with regular javac command.

BTW, we do not recommend the usage of any IDE while preparing for this exam.

HTH,
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: Bing [Bot], Google [Bot] and 37 guests