The answer provided does not seem to be correct. The Movable interface method moveBack() doesn't accept a parameter, so it is not implemented correctly in the class Donkey. Therefore it won't compile. Also in the testclass the method 'moveBack' is invoked with an int argument on an object that has the Movable as reference type. This is again not allowed and won't compile.
The correct answer should imho be that both TestClass and donkey won't Compile.
Or am I missing something...?
About Question enthuware.ocajp.i.v7.2.1403 :
Moderators: Site Manager, fjwalraven
-
- Posts: 2
- Joined: Thu Sep 04, 2014 2:09 am
- Contact:
-
- Site Admin
- Posts: 10389
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1403 :
You are right. There should be an argument in move and moveBack methods in Movable interface.
Fixed.
thank you for your feedback!
Paul.
Fixed.
thank you for your feedback!
Paul.
Who is online
Users browsing this forum: No registered users and 3 guests