posted 19 years ago
What will the above code print?
Select 1 correct option.
a It will keep on printin same values for x and y incrementing by 1 on each line.
b It will keep on printin same values for x and y but they may be incrementing by more than 1 on each line.
c It may print different values for x and y but both the values will be incrementing by 1 on each line.
d You cannot say anything about the values.
Given answer: d
I was expecting a as the o/p, since synchronized keyword is used.
Why is d) the answer?
[ March 13, 2005: Message edited by: Kedar Dravid ]
[ March 13, 2005: Message edited by: Kedar Dravid ]