This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Constructor in Abstract Classes  RSS feed

 
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
Boost this thread!