Forums Java Help What are synchronized methods and synchronized statements

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15280
    ahprofessional
    Participant

    What are synchronized methods and synchronized statements?

    #15283
    Aakanksha
    Participant

    Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the method’s object or class. Synchronized statements are similar to synchronized methods. A synchronized statement can only be executed after a thread has acquired the lock for the object or class referenced in the synchronized statement.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.