Synchronized is a keyword to tell a Thread to grab an Object lock before continuing execution.

  1. True

  2. False


Correct Option: A
Explanation:

The statement is True.

The "synchronized" keyword in Java is used to achieve thread synchronization. When a method or a block of code is declared as synchronized, it means that only one thread can access that method or block at a time.

When a thread encounters a synchronized method or block, it first checks if the lock associated with the object is available. If the lock is available, the thread grabs the lock and proceeds with executing the code inside the synchronized method or block. After the execution is complete, the lock is released, allowing other threads to access the synchronized code.

So, the "synchronized" keyword ensures that a thread grabs an object lock before continuing execution, making the statement True.

The answer is: A. True

Find more quizzes: