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

Difference between comparator and comparable in java?

1162


What does sprintf mean?

1004


What are keywords in programming?

1074


What are different ways of object creation in java ?

1154


What is an example of character?

1206


What is stack class in java?

1097


How do you take thread dump in java?

1058


Can you sort a list in java?

1037


What is the difference between compile-time polymorphism and runtime polymorphism?

1063


Is minecraft java edition free?

1170


How to add menushortcut to menu item?

1042


What is the r character?

1077


define polymorphism in java

1148


Why do we need array in java?

1056


Write a program to find the whether a number is an Armstrong number or not?

1076