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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is string buffer?

905


Why can't we use static class instead of singleton?

885


What are the differences between c++ and java?

1076


What is a condition in java?

934


How many types of memory areas are allocated by JVM in java?

1013


What is the difference between abstract class and interface1? What is an interface?

997


Explain the difference between jdk, jre, and jvm?

995


What does bitwise or mean?

1032


what is difference between equals and ==?

997


why an outer class cannot be declared as private?

4223


What is the difference between iterator and list iterator?

966


Why does java have two ways to create child threads?

908


What are advantages of using Java?s layout managers than windowing systems?

2316


Why doesn't the java library use a randomized version of quicksort?

932


How do you access command-line arguments within the code?

1003