This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud and have Kyle Brown, Bobby Woolf and Joseph Yodor on-line!
See this thread for details.

Sandeep Reddy Vinta

Greenhorn
+ Follow
since Jul 24, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sandeep Reddy Vinta

HI,
Is there any utility class in java which helps in computing Permutation and Combination?
13 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.
13 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...
13 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.
13 years ago