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 declare an array in java?

765


How do you create a method in java?

762


What is join () in java?

741


Why does the integer quotient -0/3 yield 0, but the double quotient -0.0/3.0 yields – 0.0?

836


How many types of methods are there in java?

770


Write an algorithm program in java for the following question.. 1) S is a set of integers.X is an integer obtained by sum of two digits in S. Write logic for whether or not the X is from the S. The time of algorithm should not exceed o(n logn).

1831


how to write a program for sending mails between client and server

1823


What are the restriction imposed on a static method or a static block of code?

821


What does java edition mean?

775


What is files manifesting?

1984


What is variable and example?

737


What does ide stand for?

716


Why is it called boolean?

768


Is it possible to override the main method?

745


What is the symbol for line break?

867