Click here to Skip to main content
16,004,574 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Consider the following class declarations

Object
+equals(o:Object):boolean (A)

Automobile

+equals(o:Object):boolean (B)
+equals(o:Automobile):boolean (C)





Sedan Minivan

+equals(Object o):boolean (D) +equals(Object o):boolean (G)
+equals(o:Automobile):boolean ( E) +equals(o:Automobile):boolean (H)
+equals(o:Sedan):boolean (F) +equals(o:Minivan):boolean (I)

This is dynamic binding
 Is this legal? Automobile auto = new Sedan(Color.black) (assume that Automobile has a private instance variable of type Color). Please Explain
Posted
Updated 20-Oct-11 14:26pm
v2
Comments
Sergey Alexandrovich Kryukov 20-Oct-11 20:40pm    
Which part of this text is in Java?
--SA

1 solution

Take a look at the following post, the same question is discussed.

http://www.dreamincode.net/forums/topic/252094-inheritance/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900