Inspectopedia Help

Abstract class without 'abstract' methods

Reports abstract classes that have no abstract methods. In most cases it does not make sense to have an abstract class without any abstract methods, and the abstract modifier can be removed from the class. If the class was declared abstract to prevent instantiation, it is often a better option to use a private constructor to prevent instantiation instead.

Example:

abstract class Example { public String getName() { return "IntelliJ IDEA"; } }

Use the option to ignore utility classes.

Inspection options

Option

Type

Default

Ignore utility classes

Checkbox

true

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023