Synopsis: | Classes with only private constructors should be declared as final |
Language: | Java |
Severity Level: | 3 |
Category: | Design |
Description: |
Checks that a class which has only private constructors is declared as final. Doesn't check for classes nested in interfaces or annotations, as they are always final there.
public class ClassWithPrivateConstructor { // violation private ClassWithPrivateConstructor() { } } |