Multithreading
- Which of the following will ensure the thread will be in running state?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
wait() always causes the current thread to go into the object’s wait pool. Hence, using this in a thread will keep it in running state.
- Which of the following stops execution of a thread?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
notify() wakes up a single thread which is waiting for this object.
- Which of these package provides the ability to read and write in Zip format?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
java.util.zip
- What is true about threading?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
start() eventually calls run() method. Start() method creates thread and calls the code written inside run method.
- What should not be done to avoid deadlock?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
To avoid deadlock situation in Java programming do not execute foreign code while holding a lock.