This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes core java,purpose of volatile and transient Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "core java,purpose of volatile and transient" Watch "core java,purpose of volatile and transient" New topic
Author

core java,purpose of volatile and transient

sudha priya
Greenhorn

Joined: Nov 06, 2006
Posts: 3
What is volatile and transient variables and the diffrence between them? an use in the real time?
Thank You.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Not a Servlet question, moving to the Java in General (intermediate) forum.

Dave
Ulas Ergin
Ranch Hand

Joined: Oct 10, 2002
Posts: 77
transient: indicates that the member of the class need not be serialized during serializatin process (hence need not be restored during dererialization)

volatile: indicates that the member variable is accessed by multiple threads simultaneously and certain optimizations should not be allied for it.See Java Memory Model for detailed info.
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12956
    
    3

Did you try Google? Searching for "java transient" or "java volatile" will give you a lot of information very quickly.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: core java,purpose of volatile and transient
 
Similar Threads
keywords
volatile and transient Details
Transient and volatile variables ?
variables difference
What's NOT In The Exam