• Post Reply Bookmark Topic Watch Topic
  • New Topic

Question about serialization  RSS feed

 
Vivek S. kumar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened when you tried it out?
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abimaran Kugathasan wrote:NotSerializableException will be thrown. Don't you try it?

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
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I think, he tried it and couldn't solve this problem... really sorry...
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!