Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How do we make a class serialize?

Answer Posted / javamasque

Here is the updated answer
We have to fallow below steps to serialize an object
1. The object to be serialized need to implement java.io.Serializable interface.
2. It will use Java’s default serialization mechanism.
3. Generate serial version id for that serializable object.
4. Generate serial version UID for all super classes in hierarchy (all super classes if any) otherwise the properties of all its super classes will be assigned to its default value during deserializtion.
5. ObjectOutputStream is used to write [writeObject] object.
6. FileOutputStream is used to persist in flat file.
7. The flat file extension should be (<file-name>.ser)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How define set in java?

1054


How does linkedhashmap work in java?

991


What does the append?

973


Explain method local inner classes ?

1016


What are mutable classes?

1017


What is polymorphism java example?

988


What is application system?

922


How to compare two strings in java program?

1039


If an object reference is set to null, will the garbage collector immediately free the memory held by that object?

1132


Differentiate between static and non-static methods in java.

1028


What is a singleton class? Give a practical example of its usage.

1083


What is the difference between a switch statement and an if statement?

1062


What is incompatible types in java?

1015


Explain polymorphism citing an example.

1026


What is the difference between replace and replace all?

1000