On Wed, 29 Mar 2023 08:13:06 GMT, Per Minborg <pminb...@openjdk.org> wrote:

> Non-instantiable utility classes should be declared `final` and have a 
> private constructors. 
> 
> See Effective Java, Third Edition, Joshua Bloch (for example, Item 19 or Item 
> 22).

> 

There are numerous examples in the JDK where we have the lone private 
constructor throw an exception to make sure the class isn't instantiated.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/13221#issuecomment-1488934132

Reply via email to