Multiple choice technology programming languages

Identify whether the following statement is true or false.
The keyword synchronized can be used with only a method

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The synchronized keyword in Java can be applied to both methods and code blocks. Since it is not restricted to methods alone, the statement claiming it can only be used with a method is false.