class tem{ int a=10; int b=30; int temp=a; a=b; b=temp; } }
Standard input is empty
Main.java:5: error: non-static variable a cannot be referenced from a static context int temp=a; ^ Main.java:6: error: non-static variable a cannot be referenced from a static context a=b; ^ Main.java:6: error: non-static variable b cannot be referenced from a static context a=b; ^ Main.java:7: error: non-static variable b cannot be referenced from a static context b=temp; ^ Main.java:8: error: non-static variable a cannot be referenced from a static context System.out.println("the swapped no"+a); ^ Main.java:9: error: non-static variable b cannot be referenced from a static context System.out.println("the swapped no"+b); ^ 6 errors
Standard output is empty