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

Explain the difference between a Thread and a Process.

791


What is the difference between sop and work instruction?

707


What kind of variables can a class consist?

811


What are white spaces in java?

763


Is 0 an even number?

762


what is difference betweem home interface and remote interface?

2353


Explain all java features with real time examples

1452


Can we convert integer to string in java?

838


Can inner class be public in java?

754


Is there a case when finally will not execute?

781


Why is string builder not thread safe?

847


How is tree Mirroring implemented?

834


What is native method in java?

797


What are the main uses of this keyword?

823


Explain hashset and its features?

848