LogiQuest
Back to Declarations and Access Control
20

What is the output of the following program?

public class Main {
    int x = 1;
    void show() { int x = 2; System.out.println(x + this.x); }
    public static void main(String[] args) {
        new Main().show();
    }
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.