Skip to main content

Threads — Part 2 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Threads — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/40 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 40
★ FPSC ★ PPSC

In Java, can you directly access the run() method of a Thread object?

Question 2 of 40
★ FPSC ★ PPSC

What is the purpose of the getState() method in Java threads?

Question 3 of 40
★ FPSC ★ PPSC

In Java, what is the maximum thread priority value?

Question 4 of 40
★ FPSC ★ PPSC

In java a thread can be created by ..........

Question 5 of 40
★ FPSC ★ PPSC

When a class extends the Thread class ,it should override ............ method of Thread class to start that thread.

Question 6 of 40
★ FPSC ★ PPSC

What will be the output of the following program code? public class Test implements Runnable{ public static void main(String[] args){ Thread t = new Thread(this); t.start(); } public void run(){ System.out.println("test"); } }

Question 7 of 40
★ FPSC ★ PPSC

Analyze the following code: public abstract class Test implements Runnable{ public void doSomething() { }; }

Question 8 of 40
★ FPSC ★ PPSC

Analyze the following code: public class Test implements Runnable{ public static void main(String[] args){ Test t = new Test(); } public Test(){ Thread t = new Thread(this); t.start(); } public void run(){ System.out.println("test"); } }

Question 9 of 40
★ FPSC ★ PPSC

What will be the output? class One extends Thread{ public void run(){ for(int i=0; i<2; i++){ System.out.print(i); } } } public class Test{ public static void main(String args[]){ Test t = new Test(); t.call(new One()); } public void call(One o){ o.start(); } }

Question 10 of 40
★ FPSC ★ PPSC

Which of the following are methods of the Thread class? 1) yield() 2) sleep(long msec) 3) go() 4) stop()

Question 11 of 40
★ FPSC ★ PPSC

What is the output for the below code? public class Test extends Thread{ public static void main(String argv[]){ Test t = new Test(); t.run(); } public void start(){ for(int i = 0; i < 10; i++){ System.out.println("Value of i = " + i); } } }

Question 12 of 40
★ FPSC ★ PPSC

Which keyword when applied on a method indicates that only one thread should execute the method at a time.

Question 13 of 40
★ FPSC ★ PPSC

What will be the output after compiling and executing the following code? public class Test implements Runnable{ public static void main(String[] args) throws InterruptedException{ Thread a = new Thread(new Test()); a.start(); System.out.print("Begin"); a.join(); System.out.print("End"); } public void run(){ System.out.print("Run"); } }

Question 14 of 40
★ FPSC ★ PPSC

What will be output of the following program code? public class Test implements Runnable{ public void run(){ System.out.print("go"); } public static void main(String arg[]) { Thread t = new Thread(new Test()); t.run(); t.run(); t.start(); } }

Question 15 of 40
★ FPSC ★ PPSC

Given the code. What will be the result? public class Test implements Runnable{ public static void main(String[] args) throws InterruptedException{ Thread a = new Thread(new Test()); a.start(); System.out.print("Begin"); a.join(); System.out.print("End"); } public void run(){ System.out.print("Run"); } }

Question 16 of 40
★ FPSC ★ PPSC

Which of this method is used to avoid polling in Java?

Question 17 of 40
★ FPSC ★ PPSC

What will be the output of the following Java code? class newthread implements Runnable { Thread t; newthread() { t = new Thread(this,"My Thread"); t.start(); } public void run() { System.out.println(t); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } }

Question 18 of 40
★ FPSC ★ PPSC

What will be the output of the following Java code? class newthread extends Thread { Thread t; newthread() { t = new Thread(this,"New Thread"); t.start(); } public void run() { System.out.println(t.isAlive()); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } }

Question 19 of 40
★ FPSC ★ PPSC

What will be the output of the following Java code? class newthread extends Thread { Thread t1,t2; newthread() { t1 = new Thread(this,"Thread_1"); t2 = new Thread(this,"Thread_2"); t1.start(); t2.start(); } public void run() { t2.setPriority(Thread.MAX_PRIORITY); System.out.print(t1.equals(t2)); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } }

Question 20 of 40
★ FPSC ★ PPSC

What is true about threading?

Question 21 of 40
★ FPSC ★ PPSC

What will be the output of the following Java program? class newthread extends Thread { Thread t; String name; newthread(String threadname) { name = threadname; t = new Thread(this,name); t.start(); } public void run() { } } class multithreaded_programing { public static void main(String args[]) { newthread obj1 = new newthread("one"); newthread obj2 = new newthread("two"); try { obj1.t.wait(); System.out.print(obj1.t.isAlive()); } catch(Exception e) { System.out.print("Main thread interrupted"); } } }

Question 22 of 40
★ FPSC ★ PPSC

What will be the output of the following Java code? class newthread implements Runnable { Thread t; newthread() { t = new Thread(this,"My Thread"); t.start(); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } }

Question 23 of 40
★ FPSC ★ PPSC

What will be the output of the following Java code? class newthread implements Runnable { Thread t; newthread() { t = new Thread(this,"My Thread"); t.start(); } public void run() { System.out.println(t.getName()); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } }

Question 24 of 40
★ FPSC ★ PPSC

What will be the output of the following Java code? class newthread implements Runnable { Thread t; newthread() { t1 = new Thread(this,"Thread_1"); t2 = new Thread(this,"Thread_2"); t1.start(); t2.start(); } public void run() { t2.setPriority(Thread.MAX_PRIORITY); System.out.print(t1.equals(t2)); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } }

Question 25 of 40
★ FPSC ★ PPSC

Which of these method wakes up the first thread that called wait()?

Question 26 of 40
★ FPSC ★ PPSC

Which of these keywords are used to implement synchronization? class newthread extends Thread { Thread t; String name; newthread(String threadname) { name = threadname; t = new Thread(this,name); t.start(); } public void run() { } } class multithreaded_programing { public static void main(String args[]) { newthread obj1 = new newthread("one"); newthread obj2 = new newthread("two"); try { obj1.t.wait(); System.out.print(obj1.t.isAlive()); } catch(Exception e) { System.out.print("Main thread interrupted"); } } }

Question 27 of 40
★ FPSC ★ PPSC

Which of these method is used to tell the calling thread to give up a monitor and go to sleep until some other thread enters the same monitor?

Question 28 of 40
★ FPSC ★ PPSC

What is true about time slicing?

Question 29 of 40
★ FPSC ★ PPSC

Thread priority in Java is?

Question 30 of 40
★ FPSC ★ PPSC

What decides thread priority?

Question 31 of 40
★ FPSC ★ PPSC

Which of these method wakes up all the threads?

Question 32 of 40
★ FPSC ★ PPSC

Which of the following is a correct constructor for thread?

Question 33 of 40
★ FPSC ★ PPSC

What will be the output of the following Java code? class newthread implements Runnable { Thread t; newthread() { t = new Thread(this,"New Thread"); t.start(); } public void run() { t.setPriority(Thread.MAX_PRIORITY); System.out.println(t); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } }

Question 34 of 40
★ FPSC ★ PPSC

Which of this method is used to find out that a thread is still running or not?

Question 35 of 40
★ FPSC ★ PPSC

Which of these method is used to begin the execution of a thread?

Question 36 of 40
★ FPSC ★ PPSC

What requires less resources?

Question 37 of 40
★ FPSC ★ PPSC

What will be the output of the following Java code? class newthread extends Thread { newthread() { super("My Thread"); start(); } public void run() { System.out.println(this); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } }

Question 38 of 40
★ FPSC ★ PPSC

Deadlock is a situation when thread is waiting for other thread to release acquired object.

Question 39 of 40
★ FPSC ★ PPSC

What will happen if two thread of the same priority are called to be processed simultaneously?

Question 40 of 40
★ FPSC ★ PPSC

What is the name of the thread in output in the following Java program? class multithreaded_programing { public static void main(String args[]) { Thread t = Thread.currentThread(); System.out.println(t.isAlive()); } }

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →