File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes JVM plays any role on serilization of Java Object ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JVM plays any role on serilization of Java Object ?" Watch "JVM plays any role on serilization of Java Object ?" New topic
Author

JVM plays any role on serilization of Java Object ?

Prabhat Ranjan
Ranch Hand

Joined: Oct 04, 2006
Posts: 391
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

Joined: Sep 08, 2007
Posts: 3068
    
  33

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.


Mohamed Sanaulla | My Blog
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Mar 14, 2010
Posts: 45

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.


SCJP 1.6,Preparing (Tryin to prepare) for scwcd
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JVM plays any role on serilization of Java Object ?