answersLogoWhite

0

What is volatile and why are using in java?

Updated: 8/20/2019
User Avatar

Wiki User

12y ago

Best Answer

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

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is volatile and why are using in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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


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?"


How do you execute a Java program?

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


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 is the obstacle to using hydrogen as a fuel?

It is extremely volatile.


What is a sentence with the word volatile?

I had a very good idea for a sentence using the word volatile. However, my thoughts just evaporated!