Page 1 of 1

enthuware.ocajp.i.v7.2.903

Posted: Tue Jun 10, 2014 4:26 pm
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?

Re: enthuware.ocajp.i.v7.2.903

Posted: Tue Jun 10, 2014 7:41 pm
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.

Re: enthuware.ocajp.i.v7.2.903

Posted: Sun Jan 11, 2015 9:40 am
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?

Re: enthuware.ocajp.i.v7.2.903

Posted: Sun Jan 11, 2015 10:01 am
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.