Java Threading Question and Answers

25. Is there any limitation on the number of daemon threads in an application?
  No, there is no limitation on the number of daemon threads in an application.
 
Your Name Your Email-ID
Your Answer
26. What is the use of Join method?
  The join method allows one thread to wait for the completion of another. If "t" is a Thread object whose thread is currently executing. t.join();
 
Your Name Your Email-ID
Your Answer
27. Can each Java object keep track of all the threads that want to exclusively access to it?
  Yes
 
Your Name Your Email-ID
Your Answer
28. What are some of the improvements in Concurrency API in java 8?
  Some important concurrent API enhancements are
  • ConcurrentHashMap compute(), forEach(), forEachEntry(), forEachKey(), for EachValue(), merge(), reduce() and search() methods.
  • CompletableFuture that may be explicitly completed (setting its value and status).
  • Executors newWorkStealingPool() method to create a work stealing thread pool using all available processes as its target parallelism level.
 
Your Name Your Email-ID
Your Answer
1234567 Page 7 of 7