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 |
If set accepts only one argument then how can it compare two objects to avoid duplicates
what models are available for event handling?
How many types of memory areas are allocated by jvm?
What is a qms manual?
What is static in java?
What is use of arraylist in java?
What is class variable java?
What is a list in java?
What is AppletStub?
Explain the difference between scrollbar and scrollpane?
How do you include a string in java?
what are the new features available in java 1.5 version?
3 Answers Accenture, Features, Motorola,