Machine-translated by Google. Questions are authored in English.
Top

Discussion

What does Thread.holdsLock(obj) return?

  • A.Thread
  • B.boolean
  • C.Object
  • D.void

Answer: B

holdsLock is a static method returning a boolean, reporting whether the calling thread holds the monitor of the object passed to it. It is intended for assertions and diagnostics rather than for making decisions in ordinary code.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.