• Post Reply Bookmark Topic Watch Topic
  • New Topic

Library class  RSS feed

 
Pieter Jacobs
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

Is it correct to create a "library" class and drop all common methods (e.g. ByteArrayToInt()) into it - "static final", and then call the methods without instantiating the "library" class?

Thanks
 
Roel De Nijs
Sheriff
Posts: 11095
173
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pieter,

I have created different utility classes (BooleanUtils, StringUtils, Utils,...) with static methods (not "static final") you can call without creating first an instance of the utility class. Because it is an utility class, it only exists for other classes to access its static members, so I did something (very) simple, making it impossible to instantiate an utility class.

Kind regards,
Roel
 
Pieter Jacobs
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roel,

Thanks, I'll re-think it!

Thanks.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!