Is it possible to make an array volatile?

Answer Posted / nashiinformaticssolutions

It is not possible to create a volatile with Java. Only individual variables in Java can use volatile keywords; arrays and collections cannot. When a variable is specified as volatile, its value is never cached in a thread's local memory; instead, it is always read from and written to the main memory. This makes it simpler to ensure that any changes made to the variable are visible to all threads that access it.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which java version is latest?

729


How do I find and replace in word?

734


What is singletonlist in java?

710


What is the protected method modifier?

781


Is main is a keyword?

789


What is the purpose of void class?

807


Why are functions called methods in java?

756


What is user defined exception in Java?

836


What is the meaning of variables in research?

770


How many java versions are there?

755


What is numel matlab?

998


What is the difference between stream and buffer?

724


What is lambda in java?

752


What are java packages?

804


Given a singly linked list, how will you print out its contents in the reverse order? Can you do it with consuming any extra space?

786