• Dear Guest, Please do NOT forget to join our JAVA JOBS (ONLY) FACEBOOK GROUP to be aware of latest JAVA openings, and you may also post any JAVA related queries/jobs.

How to make an object into serialize object

public class implements Serializable{
public static void main(String []args) throws Exception{
FileOutputStream fos=new FileOutPutStream("abc.txt")
ObjectOutputStream oos=new ObjectOutputStream(fos);

//here i have given main idea how to do it.implement according to ur requirment
Dear friend's,
Serialization is the process of saving an object in a storage medium (such as a file, or a memory buffer) or to transmit it over a network connection in binary form.
In otherword we can say "Writing or storing state of an object in flat file" is serelization.
The object of any class to be serialized must implement Serializable interface.

Here is the code of program:

import java.io.*;

public class SerializingObject{

public static void main(String[] args) throws IOException{

BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Please enter File name : ");

String file = in.readLine();

System.out.print("Enter extention : ");

String ext = in.readLine();

String filename = file + "." + ext;

File f = new File(filename);


ObjectOutput ObjOut = new ObjectOutputStream(new FileOutputStream(f));



System.out.println("Serializing an Object Creation completed successfully.");


catch(IOException e){





Hope u will understand for any clarification u can write me