final
or abstract
.
Utility classes have all fields and methods declared as static
.
Making them final
prevents them from being accidentally subclassed.
Example:
public class UtilityClass {
public static void foo() {}
}
After the quick-fix is applied:
public final class UtilityClass {
public static void foo() {}
}