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 |
What is an iterator interface in java programming?
Can you make a constructor final?
What is difference between this and super keyword?
Difference between object instantiation and construction ?
Is vector ordered in java?
How does hashset work in java?
What is Mutex (Mutual Exclusion Object) ?
diff. b/w JAVA and javascript...
What is a java applet? What is an interface?
Which method is used to find that the object is exited or not?
What is exception hierarchy in java?
What is treemap in java?