public abstract class StaticObject extends Object
AssertionError
and
prevents the static object from being instantiated.
The following pattern is used for creating such static helper
classes—the only constructors is declared private to gain the wished
compile-time safety:
public final class utils extends StaticObject {
private utils() {}
...
}
StaticObject
names are all lower-case in this library.Modifier | Constructor and Description |
---|---|
protected |
StaticObject()
Calling the constructor of an
StaticObject will always throw an
AssertionError . |
protected StaticObject()
StaticObject
will always throw an
AssertionError
.AssertionError
- always.© 2007-2014 Franz Wilhelmstötter (2014-03-07 19:35)