Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Private default constructor?

 
FeiWen Cheng
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I have a class which only provides static methods, should I declare a private default constructor for this class to prevent someone to create the object instance of this class?

Thanks for any suggestion!
 
Frank Verbruggen
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that is an option, as the math class:

, u could also mark the class abstract, but then people can inherit from it.
Its all your choice, as long as u document your decision.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic