Is it possible to make an array volatile?

Answers were Sorted based on User's Feedback



Is it possible to make an array volatile?..

Answer / 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

Is it possible to make an array volatile?..

Answer / 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

Is it possible to make an array volatile?..

Answer / 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

Is it possible to make an array volatile?..

Answer / 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

More Core Java Interview Questions

What is the primary benefit of encapsulation?

0 Answers  


We are seeing so many videos/audios as many web sited. But question is these videos or audios are stored in Databases ( Oracle, Mysql, Sybase,... ) or stored any file directory from there they will give the link for that? Pls explain and give sample code to achieve this one? Thanks, Seenu.

0 Answers   Symphony,


Why method overloading and method overriding required in java?

1 Answers   Ericsson, Wipro,


what is bytecode ?explain in detail and watz the difference between bytecode and machine code?

6 Answers   Lucent,


Is an array a vector?

0 Answers  


What is the specification of ?CODEBASE? in an applet?

1 Answers  


What is the default value of local and global variables?

0 Answers  


Can we have a try block without catch block?

0 Answers  


What is runtime locatable code?

0 Answers   Cognizant,


tell me some common

2 Answers   TCS,


why the primitive data type have classes?

4 Answers  


What if constructor is protected in java?

0 Answers  


Categories