• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Constructor in Abstract Classes

 
Navin Mishra
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

My first post at Javaranch.

Wanted to know what purpose does constructors serve in Abstract Classes if those classes should never be instantiated.

Regards
Navin
 
Deepak Bajoria
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Constructors in abstract classes get executed when their subclasses are instantiated. As you know there is has to be a call to super() in subclass' constructors.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic