Powered by Blogger.
Showing posts with label Synchronized. Show all posts
Showing posts with label Synchronized. Show all posts

Java - Synchronized block and method in detail

>> Saturday, September 20, 2014

Java is a multi-threaded programming language. So in every program multiple threads run in parallel to complete the program execution.At this point of time the results may differ or order of execution will change. To prevent the inaccuracy or inconsistency of data results, Java has provided 'synchronized' keyword to implement in 'synchronized block' and 'synchronized method'. The synchronized object won't allow two threads to access at the same time. So that one thread can't be reading while another updates it.The Second Thread should wait until the first is done.
Synchronized keyword in Java_JavabynataraJ

Read more..

Related Posts Plugin for WordPress, Blogger...
© javabynataraj.blogspot.com from 2009 - 2022. All rights reserved.