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...


I have a Person object with 5 variables and I want to store
them in a file called Person.txt. What should I do?

Answers were Sorted based on User's Feedback



I have a Person object with 5 variables and I want to store them in a file called Person.txt. What ..

Answer / s.ramesh

We have to implement serializable interface

Is This Answer Correct ?    2 Yes 0 No

I have a Person object with 5 variables and I want to store them in a file called Person.txt. What ..

Answer / srinu

we have imlpement ur class with java.lang.Serializible
interface and used the following steps
1)ObjectOutPutStream class(one method is their write objects
into file)
(a)writeObject(Object obj) -------> writing for objects
into file.This process is called Serializtion.

2)ObjectInputStream class reading the objects from file
(a)readObject(Object obj)---------> Reading objects from
fole This process is called Deserialization.

Is This Answer Correct ?    2 Yes 0 No

I have a Person object with 5 variables and I want to store them in a file called Person.txt. What ..

Answer / puneet

outpurstreamobject.writeobject(object o);
flush//;
close//;

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Core Java Interview Questions

explain me with a code snippet about the generation and handling of null point exceptions.

1 Answers  


What is the return type of a program?s main() method?

3 Answers  


Is there any case when finally will not be executed?

0 Answers  


What is the purpose of void class?

0 Answers  


What is a control variable example?

0 Answers  


what are the methods of an object class?

3 Answers  


why string is not taking as primitive datatypes but we r taking it as a class? why explain it?

2 Answers   HP, SparkTG,


Why is it called buffering?

0 Answers  


What is the primitive type short?

0 Answers  


What is an abstract method in java programming?

0 Answers  


Does hashset allow duplicates in java?

0 Answers  


What is substring of a string?

1 Answers  


Categories