answersLogoWhite

0

volatile variable is mainly used in multithreading environment. so let me explain it from that context.In a multithreading environment,for a variable which is not marked as volatile will be stored in local cache memory for each thread. Meaning each thread will have a local copy of the variable and they dont know about what value this variable is having in another thread. If a variable is marked volatile, then the updations to this variable will happen in the main memory and not in local cache

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is volatile thread?

Threads are not volatile. The volatile is a keyword that is used while having multiple threads in a Java Program. This keyword is used when multiple threads access a particular variable but still it is not mandatory to synchronize or prevent access to that variable.


What is a sentence using the word volatile?

the contents of this container and volatile, keep the lid on


How do you control PowerPoint slides using java?

You can control Powerpoint Slides using Java with Aspose.Slides for Java Library: - http://www.aspose.com/java/powerpoint-component.aspx


What are the technologies without using java?

you can use type writer to avoid using java :)


What are java applications?

Applications that are built using the Java language are termed as Java applications.


What is the areas of application of java?

Applications that are built using the Java language are termed as Java applications.


Has anyone developed web services using java?

of course, there are services developed using java technology


How do you execute a Java program?

You can run a Java application from the command line using "java <name of the class>"


What is a question using the word volatile?

"Are most volatile chemicals dangerous to inhale?" "How volatile is the financial market in Italy?" "What is the best way to assure that police are trained to handle volatile racial situations?"


Is it possible to draw in java without using applet?

Yes it is possible to draw in java by using AWT package. or by using javax package.


What has the author Joe Weber written?

Joe Weber has written: 'Using Java 1.2' -- subject(s): Java (Computer program language) 'Using Java 1.1' -- subject(s): Java (Computer program language)


What is the correct use of volatile in java?

It is used to alert the compiler that the value of a variable may be modified by more than one thread. As a result, the Java Virtual Machine is not allowed to do certain optimizations, which are problematic in such cases.