Hi Kim
If Ford extends Car and Car implements CarInterface, then you can do:
CarInterface someCar = new Ford();
In other words, Ford implicitly implements CarInterface.
Regards,
mihai
Kim Ching Koh a écrit :
Hi Mihai,
Do u mean instead of Ford extends Car, we should do Ford implement
CarInterface? Actuall Ford, Sedan and Truch automatically get the
interface after Car implements CarInterface, since they are subclasses
of Car. Don;t think can extends Car and implements CarInterface again?
Regards
KC
On Wed, Apr 14, 2010 at 1:30 PM, Mihai DINCA <[email protected]
<mailto:[email protected]>> wrote:
Hi KC,
Upon me there is one CarInterface. The Ford, Sedan, Truck and
other classes just implement this interface.
Regards
mihai
kc a écrit :
Hi,
I am not too sure of the homework required for Polymorphism.
Is it
just create CarInterface? Or create all FordInterface,
SedanInterface, TruckInterface? Or need to add/implement
something
else/more?
Regards
KC
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
To unsubscribe, reply using "remove me" as the subject.