MCQOPTIONS
Saved Bookmarks
| 1. |
What will be the output of the program? public static void main(String[] args) { Object obj = new Object() { public int hashCode() { return 42; } }; System.out.println(obj.hashCode()); } |
| A. | 42 |
| B. | Runtime Exception |
| C. | Compile Error at line 2 |
| D. | Compile Error at line 5 |
| Answer» B. Runtime Exception | |