What will be the output of the following code?

Last Updated :
Discuss
Comments

What will be the output of the following code?

Java
class Test {
    int x;
}
public class Main {
    public static void main(String[] args) {
        Test t = new Test();
        System.out.println(t.x);
    }
}


0

null

Compilation Error

Runtime Exception

Share your thoughts in the comments