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 |
How strings are created in java?
what is comparable and comparator interface?
What are the super most classes for all the streams?
What is primitive data type in java?
What is the hashcode () and equals () used for?
What is the use of 'super' keyword inside a constructor?
0 Answers Flextronics, Thomson Reuters, Virtusa,
What is the base class in java from which all classes are derived?
what is the main class of all the classes
what is webservices?
Why do we need wrapper class?
JVM responsibility?
List the different types of classloaders in java.