Object Oriented Programming - I (3140705) MCQs

MCQs of Concurrency

Showing 1 to 10 out of 29 Questions
1.
Which of this method can be used to make the main thread to be executed last among all the threads?
(a) stop()
(b) sleep()
(c) join()
(d) call()
Answer:

Option (b)

2.
Which of this method is used to find out that a thread is still running or not?
(a) run()
(b) Alive()
(c) isAlive()
(d) checkRun()
Answer:

Option (c)

3.
What is the default value of priority variable MIN_PRIORITY AND MAX_PRIORITY?
(a) 0 & 256
(b) 0 & 1
(c) 1 & 10
(d) 1 & 256
Answer:

Option (c)

4.
Which of these method waits for the thread to terminate?
(a) sleep()
(b) isAlive()
(c) join()
(d) stop()
Answer:

Option (c)

5.
Which of these method is used to explicitly set the priority of a thread?
(a) set()
(b) make()
(c) setPriority()
(d) makePriority()
Answer:

Option (c)

6.
What is synchronization in reference to a thread?
(a) It’s a process of handling situations when two or more threads need access to a shared resource
(b) It’s a process by which many thread are able to access same shared resource simultaneously
(c) It’s a process by which a method is able to access many different threads simultaneously
(d) It’s a method that allow too many threads to access any information require
Answer:

Option (a)

7.
Which of these method is used to implement Runnable interface?
(a) stop()
(b) run()
(c) runThread()
(d) stopThread()
Answer:

Option (b)

8.
Which of these method is used to begin the execution of a thread?
(a) run()
(b) start()
(c) runThread()
(d) startThread()
Answer:

Option (b)

9.
Which of these statement is incorrect?
(a) A thread can be formed by implementing Runnable interface only
(b) A thread can be formed by a class that extends Thread class
(c) start() method is used to begin execution of the thread
(d) run() method is used to begin execution of a thread before start() method in special cases
Answer:

Option (d)

10.
Which of these method of Thread class is used to find out the priority given to a thread?
(a) get()
(b) ThreadPriority()
(c) getPriority()
(d) getThreadPriority()
Answer:

Option (c)

Showing 1 to 10 out of 29 Questions