Sandeep Reddy Vinta

Greenhorn
+ Follow
since Jul 24, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sandeep Reddy Vinta

HI,
Is there any utility class in java which helps in computing Permutation and Combination?
12 years ago
Thanks Rob for your reply. I'll definitely take your suggestions.

I want to check whether i understood the behavior of the code properly.


In the above code i have posted.


Serialization Process.

Will not store the static information.


Desirialization Process.

Will get the static field information by loading the class. As the class ABC is already
loaded into the JVM, it refers to the static field which is already existing in the memory.
As it is changed in the constructor, the deserialization would pick the changed one from the memory.



Is this understanding proper.
12 years ago
Guys Even i'm interested in taking scjp1.6 ...Please feel free to sell you voucher to me ...But how much it costs in prometric centers...
12 years ago
I read java serialization doesn't include static variable's data. But when i run the following java file it does. It retains the value of the static variable. Can anyone explain why

Code

Output :


Before Serialization :x : 8, y :20
ABCfter Serialization :x : 0, y :20



If you observe the static variable y before serialization is initialized to 9 and later changed to 20 in constructor. After serialization is done. Now Deserializing the class shouldn't retain the static variable content according to my assumption : "java serialization doesn't include static variable's data". Why is this happening.
12 years ago