What are synchronized methods and synchronized statements in Java?

What are synchronized methods and synchronized statements?

Synchronized methods are utilized to control the access to an object especially in multithreaded programming. After acquiring the lock for an object, the thread only executes the synchronized methods.

Synchronized statements are similar to that of the synchronized methods. The variation is that the synchronized methods are part of a class and explicitly be invoked by another method. Whereas a synchronized statement is executed by its containing method which in turn accessed by another method.
Explain Java class loaders? Explain dynamic class loading?
The classes are available to the JVM and are referenced by the name. After JVM starts, it introduces the classes into it.....
Difference between an abstract class and an interface in Java.
An abstract has one or more abstract methods apart from concrete methods. All the abstract methods must be overridden by its subclasses....
What is the main difference between an ArrayList and a Vector?
Vector is synchronized where as ArrayList is not,Vector has a default size of size 10, where as ArrayList has no default size......
Post your comment