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 does || mean in code?
What are the special characters?
How we can skip finally block of exception even if some exception occurs in the exception block in java?
Differentiate between stringbuffer and string?
How do you clear an arraylist in java?
Why are variables important in research?
What is private static class in java?
What is public/private protected in java?
What are the uses of synchronized keyword?
Explain about strings in java?
What is nan in java?
what is the difference b/w PUT and POST method to send data to the server