Consider the following program and predict the output:
class Main {/*from w w w.j ava2s . co m*/ int a = 0; public static void print(int a) { this.a = a; System.out.println("a = " + this.a); } public static void main(String[] args) { Main obj = new Main(); obj.print(10); } }
a)
The keyword this cannot be used in a static method, so the program will not compile.