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

What are encapsulation, inheritance and polymorphism?

611


Write a program to show whether a graph is a tree or not using adjacency matrix.

701


What restrictions are placed on method overriding in java programming?

634


What is the purpose of object oriented programming?

616


How are variables stored in memory?

686






What are instance variables?

703


Is it possible for yielded thread to get chance for its execution again ?

644


does java support pointers?

647


What is ascii format?

641


What do you mean by data type?

632


What Is Query Throttling in java?

650


what is the major difference between linkedlist and arraylist in java?

635


Can you override static methods?

585


How does a for loop work?

620


What is a condition in java?

624