Core Java - Interview Questions and Answers for 'Volatile' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Core Java - Interview Questions and Answers for 'Volatile' - 6 question(s) found - Order By Rating

 Q1. Have you heard of volatile Table in Teradata ?Teradata
Ans. If you create table with VOLATILE option, the life of the table will be only for the current session.
It will be automatically dropped by Teradata manager once session expires.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     teradata  database  volatile table


 Q2. Can we make array volatile in Java ?Core Java
Ans. Yes, you can make an array (both primitive and reference type array e.g. an int array and String array) volatile in Java but only changes to reference pointing to an array will be visible to all threads, not the whole array

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     arrays  volatile


 Q3. What are the different ways to avoid multi Threading related problems in Java ?Core Java
Ans. Synchronization,
Concurrent classes,
Volatile keyword,
Implementing concurrent Lock interface,
Immutable classes

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     multithreading  threads  ways to avoid thread related problems  synchronization  volatile  concurrent collections      Intermediate


 Q4. how is the internal code for the "volatile" implemented ? Core Java
 This question was recently asked at 'Symantec'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     volatile     Asked in 1 Companies


Frequently asked question for intermediate developers. Frequently asked in HCL Technologies and EPAM.
  Q5. What is Volatile keyword used for ?Core Java
Ans. Volatile is a declaration that a variable can be accessed by multiple threads and hence shouldnt be cached.

  Sample Code for volatile

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   oops   synchronization   volatile   java keywords     Asked in 42 Companies      intermediate        frequent

Try 1 Question(s) Test


Advanced level question usually asked to senior developers , leads and architects.
 Q6. How does volatile affect code optimization by compiler?Core Java
Ans. Volatile is an instruction that the variables can be accessed by multiple threads and hence shouldn't be cached. As volatile variables are never cached and hence their retrieval cannot be optimized.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   java keywords   volatile   synchronization   compiler optimization   variable caching   architecture     Asked in 3 Companies      expert


 Q7. The use of volatile keyword facilitates ..Core Java
a. Making Use of Cache for better Performance
b. Avoiding use of Cache
c. Making use of Backward as well as Forward Cache
d. Keeping only one copy of variable in Cache

Ans.b. Avoiding use of Cache


Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: