This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 3064
    
  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 ?
 
Similar Threads
Marker Interface
serialisation question
JSF session sometimes behaive inconsistent on clustered environment
How Marker Interface works
Collection framework