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 the GregorianCalendar class?
Hi Every One I Have Small Doubt Please answer This???????????????????????????? I Want to use AbstractList class methods(java.util.AbstractList) My Program is import java.util.*; class DemoOne extends AbstractList { public static void main(String[] args) { AbstractList a=new DemoOne();//This One is Correct?? DemoOne a1=new DemoOne();//This One is Correct?? Both Are Not Working System.out.println("Hello World!"+a); System.out.println("Hello World!"+a1); } } Error IS: DemoOne.java:2: DemoOne is not abstract and does not override abstract method get(int) in java.util.AbstractList class DemoOne extends AbstractList AnyOne can Please Provide The Solution????????????????????????? Plzzzzzzz
How do you break a loop?
What is the static variable?
How to add and remove nodes in Jtree?
What is annotation in java?
What about instanceof operator in java?
How many inner classes can a class have?
Can sleep() method causes another thread to sleep?
What is the use of a conditional inclusion statement in Java ?
Can we override singleton class?
What is the function of static in java?