Java

Java

Made by DeepSource

Abstract class constructors should not be public JAVA-W1094

Anti-pattern
Major
Autofix

Abstract classes cannot be instantiated, so their constructors need not be public. Consider marking the constructor as protected instead.

Bad Practice

abstract class SomeClass {
    public SomeClass(...) {
        // ...
    }
}

Recommended

Make the constructor protected.

abstract class SomeClass {
    protected SomeClass(...) {
        // ...
    }
}