| Author |
Doubt abt Serialization
|
Gowher Naik
Ranch Hand
Joined: Feb 07, 2005
Posts: 643
|
|
Above code doesnot throw Exception at run time. it serialize string array(obs)without implementing Serializable interface. According to me it should throw runtime Exception(NotSerializableException). Thanks.
|
 |
Barry Gaunt
Ranch Hand
Joined: Aug 03, 2002
Posts: 7729
|
|
|
You are serializing a String array. It is the String array that has to be Serializable not class FileTest. If you print obs instanceof Serializable you will see that it returns true.
|
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
|
 |
Gowher Naik
Ranch Hand
Joined: Feb 07, 2005
Posts: 643
|
|
ok it means that String implements Serializable interface so TestFile donot required to implement Serializable. If TestFile class would be Serializing its data then Serializable interface would be required is it so?
|
 |
Naseem Khan
Ranch Hand
Joined: Apr 25, 2005
Posts: 809
|
|
10.7 Array Members Naseem
|
Asking Smart Questions FAQ - How To Put Your Code In Code Tags
|
 |
Gowher Naik
Ranch Hand
Joined: Feb 07, 2005
Posts: 643
|
|
i got it. Thanks Everyone.
|
 |
 |
|
|
subject: Doubt abt Serialization
|
|
|