Is it possible to make an array volatile?

Answer Posted / glibwaresoftsolutions

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

How do you create a bulleted list?

817


How do you compare arrays in java?

706


What is your platform?s default character encoding and how to know this?

2003


What is set in java?

756


What are the differences between abstract class and interface?

744


What is the purpose of the return statement?

778


Is binary a low level language?

703


What is string builder in java?

752


What is jvm? How its run?

866


Is ++ operator is thread safe in java?

699


Give me an example of array and linked list? Where they can be used?

761


Explain the available thread states in a high-level?

724


Can you explain the final method modifier?

763


Can a class be declared as protected?

740


How is a variable stored in memory?

747