posted 15 years ago
up to my knowledge,
writeObject() is a method of ObjectOutputStream class.there are two options for you while serializing
1. calling writeObject() method
2. overriding writeObject() method
when you call wrirteObject() method it won't serialize the instances which are declared transient.consider a case of instance transient Object of another class and you want to serilaze a member of that transient Object.then you have to override the writeObject() according your need.
when your are overriding you have to use defaultWriteObject() to ensure normal overriding apart from the this transient Object.this should be the first call before before any serializing of transient Object's members.
you normally use writeXXX() method to serialize this transient Object's members
thanks and regards<br />Santhi Bharath<br />SCJP 5.0, SCWCD 5.0