• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JVM plays any role on serilization of Java Object ?

 
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Ranch Hand
Posts: 45
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic