Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Conrad Evans   on Dec 28 In Java Category.

Question Answered By: Ziza Mizrachi   on Dec 28

the point is once the object is read  the static  field is initialized any way,

by having
a a2;

your static member variable  is initialized no matter if it has been serialized , saved, etc

so once the add method is called it will result 20 in any circumstances

instead of adding it up, print it and you'll see



This Question has 7 more answer(s). View Complete Question Thread

Didn't find what you were looking for? Find more on Serilazation Or get search suggestion and latest updates.