This is a Q from JXam.
Consider the following piece of code and select the correct statements.
1. Object o = new
String("abcd");
2. String s = o;
3. System.out.println(s);
4. System.out.println(o);
A.
The following is displayed:
abcd
abcd
B.
The code fails to compile at line 1.
C.
The code fails to compile at line 2
D.
The code fails to compile at line 4.
E.
The code can be made to compile by changing line 1 to the following:
String o = new String("abcd");
The answer given is C. But I feel it should be C & E both.
Is it possible for the Inner Class to be the Sub class of the Outer Class ??