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 |
explain me with a code snippet about the generation and handling of null point exceptions.
What is the return type of a program?s main() method?
Is there any case when finally will not be executed?
What is the purpose of void class?
What is a control variable example?
what are the methods of an object class?
why string is not taking as primitive datatypes but we r taking it as a class? why explain it?
Why is it called buffering?
What is the primitive type short?
What is an abstract method in java programming?
Does hashset allow duplicates in java?
What is substring of a string?