What happens to the static fields of a class during serialization?

What happens to the static fields of a class during serialization?

What happens to the static fields of a class during serialization?

View Answers

November 13, 2010 at 3:53 PM

Hi,

Here is the answer,

There are three exceptions in which serialization doesn?t necessarily read and write to the stream. These are

  1. Serialization ignores static fields, because they are not part of any particular state.
  2. Base class fields are only handled if the base class itself is serializable.
  3. Transient fields.









Related Tutorials/Questions & Answers:
What happens to the static fields of a class during serialization?
What is the difference between a static and a non-static inner class?
Advertisements
Fields in java class
About Static Class
Can a class be declared as static?
class static - Java Beginners
What is the importance of static variable?
Java inner class and static nested class
What is static factory pattern?
What is Calendar class in Java?
What is an Abstract Class and what is it's purpose?
Static database class - JSP-Servlet
what is the size of java class
What is Action Class?
What is an abstract class?
What is final class?
Finding out the class fields
What is the Locale class?
ModuleNotFoundError: No module named 'django-static-class-minifier'
What are the restriction imposed on a static method or a static block of code?
fields
what is class methods in objective c
what is class methods in objective c
what's the purpose of constructor in abstract class?
What is a local, member and a class variable?
What is the base class of all classes?
what is static synchronizes - Java Interview Questions
What is inner class in Java? - Java Beginners
Access Static Member Of The Class Through Object
What is the difference between static and dynamic SQL?
Core Java Interview Question Page 8
What is nested class in Java with Example?
What is nested class in Java with Example?
JAVA what is different between static block and public static void main(String a[]) method
Example of a class variable (static variable)
STATIC
What are the difference between abstract class and interface?
What does it mean that a class or member is final?
What are the different types of property and class mappings?
If I open .class file with notepad what is displayed?
Squaring of two number in Static class
Getting Fields Information of a class
static
what is the working of JVM when An object is created of a class?
static
What happen when we write static public void instead of public static void?
static
Static Nested Classes
What is Static Website
Static

Ads