I have a Person object with 5 variables and I want to store
them in a file called Person.txt. What should I do?
Answer Posted / 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 |
Post New Answer View All Answers
Difference between comparator and comparable in java?
What does sprintf mean?
What are keywords in programming?
What are different ways of object creation in java ?
What is an example of character?
What is stack class in java?
How do you take thread dump in java?
Can you sort a list in java?
What is the difference between compile-time polymorphism and runtime polymorphism?
Is minecraft java edition free?
How to add menushortcut to menu item?
What is the r character?
define polymorphism in java
Why do we need array in java?
Write a program to find the whether a number is an Armstrong number or not?