This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Abstract class and private constructor

 
Sri Rajasekhar Jonnalagadda
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider the following code
abstract class A {
private A() {}
}
How can a class which is supposed to be extended
have a constructor which is private.
 
dennis zined
Ranch Hand
Posts: 330
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This will only work if the abstract class is nested.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic