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

We have to fallow below steps to serialize an object
1. The object to be serialized need to implement java.io.Serializable / java.io. Externalizable interface.
2. Generate serial version id for that serializable object.
3. ObjectOutputStream is used to write [writeObject(..) or wirteExternal()] object.
4. FileOutputStream is used to persist in flat file.
5. The flat file extension should be (<file-name>.ser)

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we have static methods in an interface?

1103


What is run time allocation?

1075


Which is dependent variable?

949


Can we sort set in java?

1004


How is Object Oriented Programming different from Procedure Oriented Programming?

1086


What exactly is java?

995


Is java 11 paid version?

1041


What are variable names?

1015


What are the characteristics of java?

1118


What is a linkedhashmap java?

1053


What is a protected class in java?

1045


Explain the difference between collection api and stream api in java8?

1020


Why is singleton class used?

1079


What are loops in java?

1346


Is string serializable in java?

1064