What changes will lead to a successful compilation of the following code? Select all that apply.

public class LocalVsInstance {    
    String s;
    
    public static void main(String[] args) {
        String s;
        System.out.println(s.toUpperCase());
        LocalVsInstance localVsInstance = new  LocalVsInstance();
        System.out.println(localVsInstance.s.toUpperCase());
    }

}

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes