• 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

How many Objects get Serialized

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends
I Have a doubt if we serialize the object then what will happen to those refrences which are stored in this object and what happend when this class extends some super class . will that super class will also be serialised with it ?
e.g
class super(){ int i = 10;}
class sub extends super()
{
Byte b = new Byte(10);
class AnyotherClass ao = new AnyotherClass();
}
How many objects are serialized when we try to serialize one object of sub class
Thanks
Naveen
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I understand your question correctly, your sub class object contains all of the instance variables inherited from the superclass. If these variables include references to other objects, Serialization automatically serializes them also.
Bill

------------------
author of:
 
Paddy spent all of his days in the O'Furniture back yard with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic