Analyze the following code. public class Test { int x; public Test(String t) { System.out.println("Test"); } public static void main(String[] args) { Test test = new Test(); System.out.println(test.x); } }
The program has a syntax error because System.out.println method cannot be invoked from the constructor.
The program has a syntax error because x has not been initialized.
The program has a syntax error because you cannot create an object from the class that defines the object.
The program has a syntax error because Test does not have a default constructor.