ERROR - illegal modifier for the class ; only public abstract & final are permitted

Error

illegal modifier for the class ; only public abstract & final are permitted

Error Type 

Compile Time

Sample Code 

public static class Test extends ParentTest {
private String element = "Hello";

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;
}
}