Answer Posted / pasindu
Trsnsient:
If you mark an instance variable as transient you're telling
the JVM to skip this variable when you attempt to serialize
the object containing it.
Volatile:
The volatile modifier tells the JVM that a thread accessing
the variable must always reconcile its own private copy of
the variable with the master copy in memory.
It can be apply only to instance variables.
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
Which methods are used during serialization and deserialization process?
Is java util list serializable?
Explain the difference between a Thread and a Process.
Is heap stored in ram?
Describe method overriding
When object is created and destroyed?
What is the purpose of default constructor?
Does java return by reference?
How do you remove duplicates in java?
What is lazy programming?
What does %4d mean in java?
What is the purpose of encapsulation?
What is an object’s lock and which object’s have locks?
Can an object subclass another object?
What is a singleton puppy?