Infolinks In Text Ads

Volatile and Transient modifier in java

Volatile :
volatile keyword mostly not used by the user.... actually this is just to tell that this variable's value in future can be changed unexpectedly.
Transient: 
  transient is useful when we work with serialization ....
As serialization is used to store the state of an object here if we don't want to store the state of any variable or field then we declare it with transient modifier as ....

transient int a;

now this field will not be serialized.


 

Newer Post Older Post

Leave a Reply

Powered by Blogger.