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

Discussion

Which one of these lists names only types in java.util.concurrent?

  • A.ExecutorService, CountDownLatch, TimeUnit
  • B.Thread, Runnable, ThreadLocal
  • C.ExecutorService, Runnable, Object
  • D.CountDownLatch, Thread, InterruptedException

Answer: A

ExecutorService, CountDownLatch and TimeUnit all live in java.util.concurrent and need importing. Thread, Runnable, ThreadLocal, Object and InterruptedException are all in java.lang, which is why basic thread code compiles with no import line.

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

Post your comment

Please log in or register to post a comment.