What are Transient and Volatile Modifiers?
Answer Posted / janet
Transient: The transient modifier applies to variable only
and it is not stored as part of it's objects persistent
state.Transient variables are not serialized.
Volatile: Volatile modifier applies to variables only and
it tells the compiler that the variable modified by
volatile can be changed unexpectedly by other parts of the
program.
| Is This Answer Correct ? | 22 Yes | 4 No |
Post New Answer View All Answers
What is the difference between error and an exception?
What is equlas() and hashcode() contract in java? Where does it used?
Which arithmetic operations can result in the throwing of an arithmeticexception?
Is namespace same as package in java?
What is the collection interface?
How does the java compiler work?
Which is better stringbuffer or stringbuilder?
Explain differences between collection api and stream api?
what is the major difference between linkedlist and arraylist in java?
Does string is thread-safe in java?
Can a method be static?
Difference between string, stringbuffer and stringbuilder?
What is the Scope of Static Variable?
why Java does not support multiple inheritances?
What are the important methods of java exception class?