1. What is the output of the following program? class MyClass { int var; int getVar() { return var; } public static void main(String[] args) { System.out.println(getVar()+1); } } (a) 0 (b) 1 (c) compilation error (d) runtime error 2.
1. What is the output of the following program? class MyClass { int var; int getVar() { return var; } public static void main(String[] args) { System.out.println(getVar()+1); } } (a) 0 (b) 1 (c) compilation error (d) runtime error 2.