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

Discussion

Which of these types is generic?

  • A.ThreadLocal
  • B.Thread
  • C.ThreadGroup
  • D.InterruptedException

Answer: A

ThreadLocal is declared with a type parameter, so its get and set exchange that type without a cast. Thread, ThreadGroup and InterruptedException carry no type parameter, which is why a Thread cannot be declared to produce a particular result type.

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

Post your comment

Please log in or register to post a comment.