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 the meaning of 3 dots in java?

894


What is abstract class? Explain

795


What is difference between ++ I and I ++ in java?

726


What is a string token?

743


What is thread safe in java?

752


What does jenkins do?

690


What are the advantages and disadvantages of reference counting in garbage collection?

784


What are the actions that can occur when a thread enters blocked state?

825


What is native method in java?

797


What is functional interface in javatpoint?

740


Differences between external iteration and internal iteration?

875


What is generics in java interview questions?

788


What are different types of multitasking?

746


What will be the default values of all the elements of an array defined as an instance variable?

784


If you are given the name of the function at run time how will you invoke the function?

902