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

What is meant by attribute?

776


Can private class be extended java?

764


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

842


What does it mean that a class or member is final?

748


Explain scope or life time of local variables in java?

781


What is the difference between the jdk 1.02 event model and the event-delegation model introduced with jdk 1.1?

854


Can we use both this () and super () in a constructor?

771


How does indexof work?

724


What is a parameter in simple terms?

751


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

2006


What is the common usage of serialization?

808


What is the latest version of java?

798


What are annotations in java?

842


Under what conditions is an object’s finalize() method invoked by the garbage collector?

786


What is the difference between method and means?

794