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
What are the different conditional statements?
What do you mean by stream pipelining in java 8?
Why are generics used?
what is the purpose of using rmisecuritymanager in rmi?
What is toarray method in java?
Does printwriter create a file?
Enlist few advantages of inheritance?
Does constructor creates the object ?
What does the “static” keyword mean?
What does @override mean?
What is boolean data type in java?
What is a conditional equation?
What is lambda in java?
What data type is a string?
What is the use of math abs in java?