What is the result of compiling and running the given code? public class Test75 { public static void main(String[] args) { System.out.println(new A(){{}}.toString()); } } class A { public String toString() { return getClass().getName(); } }
Correct Answer: It compiles, but throws NullPointerException at run-time.
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Java MCQ Questions