Benefit of providing a super-class reference to a subclass object ?
Prince Chauda
Greenhorn
Joined: Feb 13, 2008
Posts: 8
posted
0
While providing a reference of a super-class to the object of the sub-class we are simply
decreasing the usability of that object because it can not call the methods declared only in its own class.
So what are the benefits (other than tight encapsulation and loose coupling ) of this feature of java ?
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32692
4
posted
0
You can use polymorphism. You will have to look in the books or tutorials for more details.