What is volatile and transient variables in Java

Tutorials Shared by the Internet Community

Advertisements


Synopsis

transient and volatile are two different but less used variables in Java. There are many differences between these two like: Transient variable is use

Statistics

  • Total Hits - 27516

  • Total Votes - 144 votes

  • Vote Up - 68 votes

  • Vote Down - 76 votes

  • Domain - javarevisited.blogspot.com

  • Category - JAVA/Core JAVA

  • Submitted By - Javin Paul

  • Submitted on - 2012-06-23 04:07:47

Description

transient and volatile are two different but less used variables in Java. There are many differences between these two like:
Transient variable is used to make the variable out of synchronization. Volatile variable is used when the variable is changing
it's state continuously
transient variables can not be serialized. Volatile variables may change with the affect of other one ...


Site  |   Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down

Advertisements