Error
illegal modifier for the class ; only public abstract & final are permitted
Sample Code
public static class Test extends ParentTest {
illegal modifier for the class ; only public abstract & final are permitted
Error Type
Compile Time
Compile Time
Sample Code
public static class Test extends ParentTest {
private String element = "Hello";
private String getString(){
return element;
}
}
private String getString(){
return element;
}
}
Cause
We cannot have any other modifier for top level class other than public , abstract and final. Class cannot be static.
Resolution
Remove static
public class Test extends ParentTest {
private String element = "Hello";
private String getString(){
return element;
}
}
private String element = "Hello";
private String getString(){
return element;
}
}