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?K is a valid interface because an interface is permitted to extend another interface.
enthuware.ocajp.i.v7.2.903
Moderator: admin
-
- Posts: 1
- Joined: Sat Jun 07, 2014 6:03 am
- Contact:
enthuware.ocajp.i.v7.2.903
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: enthuware.ocajp.i.v7.2.903
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 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.
-
- Posts: 1
- Joined: Sun Feb 09, 2014 6:53 pm
- Contact:
Re: enthuware.ocajp.i.v7.2.903
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?
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?
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: enthuware.ocajp.i.v7.2.903
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.
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.
Who is online
Users browsing this forum: No registered users and 40 guests