Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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