Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JVM plays any role on serilization of Java Object ?

 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

is JVM pays any role to serialize the java object.

one thing i know it marks up the object using marker interface serilizable.

one more thing if we don't implement serilizable interface then will get error:

java.io.NotSerializableException: PersonDetails

means it is mandatory to implement that interface.
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JVM plays complete role in any aspect related to Java, nothing specific about Serialization. And yes, the Serializable interface is required to mark the objects of the class as serializable.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prabhat Ranjan wrote:
is JVM pays any role to serialize the java object.

JVM plays complete role on serialization. actually serialization is a Jvm mechanism.

Prabhat Ranjan wrote:it is mandatory to implement that interface.

Yes. it is mandatory. so that Jvm can understand[by using instanceof operator] that this object can be serialize .
 
Harsha Ka
Ranch Hand
Posts: 45
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And adding to the fact..If an object is serializable on one JVM, it WILL be serializable in any JVM as mandated by Java spec.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic