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
In a class implementing an interface, can we change the value of any variable defined in the interface?
What is java basic concept?
What is the difference between the direct buffer and non-direct buffer in java?
What are the advantages of java over C++?
Is singleton set an interval?
Explain the difference between static and dynamic binding in java?
Why we override equals() method?
What is vector?
What is java util function?
How do you clear a method in java?
What are advantages of using Java?s layout managers than windowing systems?
Name few java util classes introduced with java 8 ?
What is a ?
What is the difference between yielding and sleeping?
Explain the difference between protected and default access.