The following declarations are illegal for default modifier : default modifier « Modifiers « SCJP






// default isn't a keyword

public class MainClass{
    default void main(){ //Error
        System.out.println();
    }
}








3.3.default modifier
3.3.1.The default access mode (no modifier)
3.3.2.The following declarations are illegal for default modifier
3.3.3.Default is the name for empty modifier.
3.3.4.Default modifier for method