UrbanPro

Learn IT Courses from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is volatile variable in java. When it can be useful.

Asked by Last Modified  

4 Answers

Follow 0
Answer

Please enter your answer

Trainer

volatile is used to indicate that a variable's value will be modified by different threads. Value will not be stores in thread cache. All the operations will work with the main copy. Its acts as it is in a synchronized block.
Comments

Tutor

volatile variable in Java is a special variable which is used to signal threads, compiler that this particular variables values is going to be updated by multiple thread inside Java application. By making a variable volatile using volatile keyword in Java, application programmer ensures that its value...
read more
volatile variable in Java is a special variable which is used to signal threads, compiler that this particular variables values is going to be updated by multiple thread inside Java application. By making a variable volatile using volatile keyword in Java, application programmer ensures that its value should always been read from main memory and thread should not used cached value of that variable from there own stack. When to use Volatile variable in Java This is the most important thing to learn while learning about volatile variable in Java. When to use volatile variable in Java is also a famous multi-threading interview question in Java. here are some of the scenario where you can use volatile variable in Java : 1) Any variable which is shared between multiple threads should be made variable, in order to ensure that all thread must see latest value of volatile variable. 2) A signal to compiler and JIT to ensure that compiler does not change ordering or volatile variable and moves them out of synchronized context. 3) You want to save cost of synchronization as volatile variables are less expensive than synchronization. read less
Comments

Tutor

http://java67.blogspot.in/2012/08/what-is-volatile-variable-in-java-when.html
Comments

Tutor

http://java.dzone.com/articles/java-volatile-keyword-0
Comments

View 2 more Answers

Related Questions

Can I become an expert in Visual Basic Training?
yes you can become expert in visual basic training
Kanu
Is it possible to instantiate the abstract class?
Use anonymous class. Example: For an abstract class AbstrClass. AbstrClass ac = new AbstrClass() { public void m1() { // code...
Reshma
How can I start doing mobile app development
Hi , All you need is knowledge on Core Java, and Read Android basics and try sample programming from Online Videos. Happy Coding
Rathnasri
My name is Rajesh , working as a Recruiter from past 6 years and thought to change my career into software (development / admin/ testing ) am seeking for some suggestion which technology I need to learn ? Any job after training ? Or where I can get job within 3 months after finishing my training programme- your advices are highly appreciated
Mr rajesh if you want to enter in to software Choose SAP BW AND SAP HANA because BW and HANA rules the all other erp tools next 50 years.it provides rubust reporting tools for quicker decesion of business It very easy to learn
Rajesh
1 0
6

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

IKIGAI: A Japanese Philosophy To Choose A Right Career
How to choose a right career? A question normally being asked to me in every interaction I had with students. Okinawa, an island in Japan observes highest life expectancy in the world. Upon further...

Practicing Chef with out installing on your server
Hi Students, Go to the following webiste and create your free account. https://manage.chef.io/login You can practice on your won without having to install Chef for DevOps practice. Create AWS instances...

VLOOKUP and LIST Creation Explained
.) This table is in the range A1:D4. You want to find the salary of employee with ID 102. Excel =VLOOKUP(102, A1:D4, 4, FALSE) 102: The Employee ID (your lookup_value). A1:D4: The table containing...

Ganesh S.

0 0
0

What is Logistic Regression Model ?
Logistic regression is a form of regression which is used when the dependent is a dichotomy (yes or no) and the independents of any type (either continuous or binary). Logistic regression can be used...

Compiling C program on Linux machine GCC ,GDB
Linux have powerful tool called "Terminal". From "terminal" we can command the machine. For any programming language the required tools are editor, compiler and debugger. Compiler will check the syntax...
N

Narasimha Reddy

0 0
0

Recommended Articles

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

Read full article >

Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...

Read full article >

Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...

Read full article >

Looking for IT Courses ?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for IT Courses Classes?

The best tutors for IT Courses Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn IT Courses with the Best Tutors

The best Tutors for IT Courses Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more