This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one 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
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 361
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
Bartender

Joined: Sep 08, 2007
Posts: 2925
    
  15

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: 42

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://jrebel.com/download
 
subject: JVM plays any role on serilization of Java Object ?
 
Similar Threads
serialisation question
JSF session sometimes behaive inconsistent on clustered environment
How Marker Interface works
Collection framework
Marker Interface