| Author |
Why not its ClassCastException?
|
m ali
Ranch Hand
Joined: Apr 12, 2007
Posts: 49
|
|
Hi, Please anyone let me know why the following code not giving an error at compile time? Thanks in Advance.
|
 |
Chandra Bhatt
Ranch Hand
Joined: Feb 28, 2007
Posts: 1707
|
|
Hi Ali, Try this, Regards, cmbhatt
|
cmbhatt
|
 |
Chandra Bhatt
Ranch Hand
Joined: Feb 28, 2007
Posts: 1707
|
|
Hi Ali, Try this code too, Runtime type of the o1 is Stone that is Serializable; Allright! No NonSerializable class exception at runtime!!! Regards, cmbhatt
|
 |
m ali
Ranch Hand
Joined: Apr 12, 2007
Posts: 49
|
|
Hi Chandra, Thanks for your explanation. In your 2nd explanation the Stone class is marked as Serializable, its ok. Then what about 1st?, array(Object) is also implemented Serializable interfece? I think, then only i can able to assign the object reference to Serializable reference. am i correct? please clarify? Thanks in Advance.
|
 |
 |
|
|
subject: Why not its ClassCastException?
|
|
|