gs gs128 Java Multithreading - Java Multithreading - Quiz No.1
gs gs128 Java Quiz
This quiz belongs to book/course code gs gs128 Java of gs organization. We have 136 quizzes available related to the book/course Java. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Java Multithreading. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
Question 1: What requires less resources?
Thread
Process
Thread and Process
Neither Thread nor Process
Question 2: What does not prevent JVM from terminating?
Process
Daemon Thread
User Thread
JVM Thread
Question 3: What decides thread priority?
Process
Process scheduler
Thread
Thread scheduler
Question 4: What is true about time slicing?
Time slicing is OS service that allocates CPU time to available runnable thread
Time slicing is the process to divide the available CPU time to available runnable thread
Time slicing depends on its implementation in OS
Time slicing allocates more resources to thread
Question 6: What should not be done to avoid deadlock?
Avoid using multiple threads
Avoid hold several locks at once
Execute foreign code while holding a lock
Use interruptible locks
Question 7: What is true about threading?
run() method calls start() method and runs the code
run() method creates new thread
run() method can be called directly without start() method being called
start() method creates new thread and calls code written in run() method
Question 8: Which of the following is a correct constructor for thread?
Thread(Runnable a, String str)
Thread(int priority)
Thread(Runnable a, int priority)
Thread(Runnable a, ThreadGroup t)
Question 9: Which of the following stops execution of a thread?
Calling SetPriority() method on a Thread object
Calling notify() method on an object
Calling wait() method on an object
Calling read() method on an InputStream object
Question 10: Which of the following will ensure the thread will be in running state?
yield()
notify()
wait()
Thread.killThread()