• Post Reply Bookmark Topic Watch Topic
  • New Topic

Benefit of providing a super-class reference to a subclass object ?  RSS feed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Marshal
Posts: 58295
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use polymorphism. You will have to look in the books or tutorials for more details.
 
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Prince Chauda wrote:...other than tight encapsulation and loose coupling...


Would that not be "enough"?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!