• Post Reply Bookmark Topic Watch Topic
  • New Topic

why serialize needs the .class file?  RSS feed

 
Jimmy Chen
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Bruce Eckel said in "Thinking in Java", When we deserialize an object(like "Aobj") from a file we still need the class file("Aobj.class") in the classpath.

why?

Is it the same in Java RMI when we transmit the object between the RMI server and clients?
 
William A White
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Serialization only stores the state of the object. A new object is built from the .class file and the saved state is applied to it.
 
Jimmy Chen
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!