Answered Questions

  • Can we serialize the static variable?

    ashok

    • Oct 14th, 2018

    Your example absolute good but, we cant serialize static and transient. if you want deserialize again and check it it goes to default values means that variables are new variables to deserialization class.

    shanu

    • May 9th, 2016

    You cannot serialize static variable as they belong to class not obj. and serialization is all about object. static int x= 10; int y =5 , if you seralize both the ans will be 10 and 5. But wait 10 is...