Java Multithreading Question and Answers

5. What is daemon thread?
  Daemon thread is a low priority thread, which runs intermittently in the back ground doing the garbage collection operation for the java runtime system.
 
Your Name Your Email-ID
Your Answer
6. What is the use of volatile in Java?
 
  • Threads are allowed to hold the values of variables in local memory (e.g. in a machine register).
  • If a variable is marked as volatile, every time when the variable is used, it must be read from the main memory, similarly every time the variable is written, the value must be stored in main memory.
 
Your Name Your Email-ID
Your Answer
7. Is there a separate stack for each thread in java?
  No
 
Your Name Your Email-ID
Your Answer
8. What is the difference between multithreading and multitasking?
 
  • A Web Server understands and support only HTTP protocol whereas the Application Server supports HTTP, TCP/IP and many more protocols.
  • Also many more features such as Caches, Clusters, Load Balancing are there in Application Servers which are not available in Web Servers.
  • We can also Configure Application Servers to work as Web Server.
  • In Application Server is a super set of which Web Servers is a subset.
 
Your Name Your Email-ID
Your Answer
12345678910 Page 2 of 10