| Author |
Question about serialization
|
Vivek S. kumar
Greenhorn
Joined: Dec 19, 2006
Posts: 25
|
|
Hello
I have class implementing Serializable
and it have a data member of type Object.
As a plain java Object is not serializable so what will happen in this case?
Only this method will not be serialized or the entire class will not be serialized?
Vik
|
"Make Your Own Rules and Rock The World"
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12929
|
|
|
What happened when you tried it out?
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Abimaran Kugathasan
Ranch Hand
Joined: Nov 04, 2009
Posts: 2066
|
|
Vivek S. kumar wrote:Hello
I have class implementing Serializable
and it have a data member of type Object.
As a plain java Object is not serializable so what will happen in this case?
Only this method will not be serialized or the entire class will not be serialized?
Vik
You mean to say, "Only this Object........."?
NotSerializableException will be thrown. Don't you try it?
|
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
|
 |
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
|
posted

0
|
Well, now he doesn't have to, because you flat-out told him. In general, we like to have people try things out on their own.
|
 |
Abimaran Kugathasan
Ranch Hand
Joined: Nov 04, 2009
Posts: 2066
|
|
|
Sorry, I think, he tried it and couldn't solve this problem... really sorry...
|
 |
 |
|
|
subject: Question about serialization
|
|
|