Results 1 to 6 of 6
  1. #1
    Senior Member dennis123's Avatar
    Join Date
    Apr 2013
    Location
    Bangalore
    Posts
    1,494

    What is volatile keyword in Java?

    What is volatile keyword in Java?

  2. #2
    Registered User albertocosta's Avatar
    Join Date
    Jan 2016
    Posts
    47
    Volatile Keyword we only where we do not want cache value of this variable and give a action to always read it from main memory. Most important things it cannot be used with method or class, only used with a variable.

  3. #3
    Registered User
    Join Date
    Sep 2017
    Posts
    1,129
    Declaring An unstable java variable means: the quality of this variable will never a chance to be cached thread-locally: all peruses Furthermore composes will try straight should "main memory"; right of the variable goes about Likewise In spite of it may be encased to a synchronized block, synchronized on itself.

  4. #4
    Registered User
    Join Date
    Jun 2016
    Location
    Mumbai
    Posts
    873
    The volatile keyword could be used on every kind of variable, either primitive or objects!

    Fastmailsender

  5. #5
    Registered User 24x7servermanag's Avatar
    Join Date
    Jul 2017
    Location
    India
    Posts
    1,022
    Volatile keywords in the Java are used to stored in the main memory of the Java. Every time the volatile keyword will be read from the computer's main memory. The volatile keyword is guaranteed to work on 32 bit and 64 variables. They used to synchronised by themselves.
    Server Management Company
    India's Leading Managed Service Provider | Skype: techs24x7
    Cpanel Technical Discussions - Lets talk !

  6. #6
    Registered User
    Join Date
    Sep 2017
    Location
    ghaziabad
    Posts
    280
    The volatile keyword is used when the thread is created, it copies the value of all accessible variables in its own memory. The value of this variable will never be cached thread locally. All the reads and writes will go straight to the main memory.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

  Find Web Hosting      
  Shared Web Hosting UNIX & Linux Web Hosting Windows Web Hosting Adult Web Hosting
  ASP ASP.NET Web Hosting Reseller Web Hosting VPS Web Hosting Managed Web Hosting
  Cloud Web Hosting Dedicated Server E-commerce Web Hosting Cheap Web Hosting


Premium Partners:


Visit forums.thewebhostbiz.com: to discuss the web hosting business, buy and sell websites and domain names, and discuss current web hosting tools and software.