public class
Test {
static int total = 10;
public static void main (
String args []) {
new Test();
}
public Test () {
System.out.println("In test");
System.out.println(this);
int temp = this.total;
if (temp > 5) {
System.out.println(temp);
}}}
The compiler reports an error at line 2
The class will not compile
The value 10 is one of the elements printed to the standard output
The compiler reports an error at line 9
The class compiles but generates a runtime error
i answered the 4th option,but the correct answer is 3.
i answered 4th, bcos static variables cannot have a this reference.
plz correct me, wht is wrong?