Why we need to serialize the object
Answers were Sorted based on User's Feedback
Answer / sandeep jaisawal
For an example,if you are suppose to send some data from
obe JVM to other JVM, in that case state of ojects are not
known and will not persist if you dont serialize the object
and sent over a network.
because you allocate seperate heap for seperate JVM.
So you have to tell JAVA that please treat my object, in a
different way because i have make them serialised...
Once the data(object) is serialised, you cant send it any
wr like, write in to DB,othere JVM,files etc. and later
point of time you can deserialise them and you can the same
state of the object.
Hope this help.
Sandeep j
| Is This Answer Correct ? | 39 Yes | 3 No |
Serialization is the process of saving the state of an object by converting it to a stream of bytes.the main purpose of serialize the object is to save the state of an object in order to have the ability to recreate the same object when required.
| Is This Answer Correct ? | 23 Yes | 2 No |
Answer / balaji
when ever an object's state needs to be saved to retrieve it
after some time we need to serialize the object.
Serialization is the process of writing the state of an object
to the stream.
The state of an object will be available in instance variables.
| Is This Answer Correct ? | 27 Yes | 7 No |
Answer / ashwin
mr.sandeep ur answer is little bit clear but wat happens if
i dont serialize and send thro a network will there any
dataloss ?
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / vivek
Perfect answer !! http://stackoverflow.com/questions/5877808/when-should-i-use-serializable-in-c
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sreenivasulu
if you don't serialize and send ur data over the network
there may be loss of data.
say for example if you declare your variable as a transient
and sent over network you will loose the data.
| Is This Answer Correct ? | 3 Yes | 8 No |
Answer / saravana shankar
because the function to be indentified the object to the
variable.. so it needs to be serialize it ..
| Is This Answer Correct ? | 3 Yes | 19 No |
How can you write a loop indefinitely in java programming?
What is meant by oops concept in java?
How many bits is a boolean?
Explain access specifiers?
0 Answers Thomson Reuters, Virtusa,
Explain the selection sort algorithm and state its time complexity?
How do I remove a character from a string in java?
What is string data type?
Name four container classes.
11. static class A { 12. void process() throws Exception { throw new Exception(); } 13. } 14. static class B extends A { 15. void process() { System.out.println(”B”); } 16. } 17. public static void main(String[] args) { 18. new B().process(); 19. } What is the result? 1 B 2 The code runs with no output. 3 Compilation fails because of an error in line 12. 4 Compilation fails because of an error in line 15.
How many types of interfaces are there?
How can constructor chaining be done using this keyword?
my method "abc" return array of interface "xyz" and "pqr" is abstract class implements abc and class "jkl" extends pqr My problem 1) when i call abc it retrun array xyz how can i do this hint xyz refer_xyz = new jkl(); but i can't create array. 2)I want to access method of jkl using reference of xyz??