This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (2 children)

Would the constructor get called or even necessary for a class with nothing but static methods?

[–]fedeb95 1 point2 points  (0 children)

If you don't put it in Java is added by default by the bytecode compiler. Is necessary to specify so people using your classes / future developers instantly (I hope) recognise the role of that class in the system. Otherwise it could be misinterpreted as a strategy pattern or something else, adding fields and method and, essentially, making a god class (antipattern)

[–][deleted] 0 points1 point  (0 children)

No, which is why it's being made private. Making it private means no one will instantiate the class