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
Can we sort a map in java?
What is a lock or purpose of locks in java?
Can we declare a constructor as final?
does java support pointers?
How to create a fecelet view?
why doesn't java run on all platforms?
What is a copy constructor in java?
What about interrupt() method of thread class ?
What flag up means?
Is string is a data type in java?
what is inner class in java?
Say any two properties in beans?
Can we define static methods inside interface?
Explain JMS in detail.
What is java command?