I have a Person object with 5 variables and I want to store
them in a file called Person.txt. What should I do?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / puneet
outpurstreamobject.writeobject(object o);
flush//;
close//;
| Is This Answer Correct ? | 0 Yes | 2 No |
Is null function in java?
Is java code slower than native code?
What are the types of inner classes (non-static nested class) used in java?
Why is java called the platform independent programming language?
Explain the difference between jdk, jre, and jvm?
What is the difference between array list and vector in java?
What is oop in java?
What are the pillars of java?
How does java pattern compile work?
Can constructor be inherited?
Which package has light weight components?
What is java object name?