Wednesday, April 27, 2011

Compiler Error

Name the error in the following code:

public void foo() {
int x;
System.out.println(x);
}



ANSWER:

Compiler error. x is not initialized.