Will the following code compile?

public class StartClass {    
    private final String DUMMY = "DUMMY";
    
    public static void main(String[] args) {
        System.out.println(DUMMY);
    }
}
Explanation
It is impossible to address non-static context from a static one.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback