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
Java is Pass by Value or Pass by Reference?
What is final method in java?
What is starvation?
What is the exact difference in between unicast and multicast object? Where we will use?
What are the types of collections in java?
What is static import?
What is private protected in java?
What are voids?
What is a parameter in a function?
What are the difference between composition and inheritance in java?
Can you give names of Container classes?
What is append function?
What is return type in java?
What is a dot notation?
Explain about main thread in java?