Extending non-instantiable class in java
<p>I read "Effective Java" by Joshua Bloch and removed the 'Constant Interface anti-pattern' from our application. The trick is to use Non-instantiable util class whose constructor is private, and define all the constants as 'public static final'</p>

<p>I have to extend the this constant util class. I can only do this when I change the constructor to protected.</p>

<p>Could somebody suggest a better way.</p>

<pre><code>public class Constants {
    private Constants () {} // Prevent instantiation
    public static final String MyString = "MyString";
}

public class MyConstants extends Constants {
    private MyConstants () {} // Compiler error : Implicit super constructor Constants() is not visible.
    public static final String MySecondString = "MySecondString";
}
</code></pre>
