Font size
Worksheetsmutithreading MCQ'S in java
Total questions: 20
Worksheet time: 19mins
Q) Number of threads in below java program is
public class ThreadExtended extends Thread {
public void run() {
System.out.println("\nThread is running now\n");
}
public static void main(String[] args) {
ThreadExtended threadE = new ThreadExtended();
threadE.start();
}
}
0
1
2
3
The life cycle of a thread in java is controlled by
JRE
JDK
JVM
None
Thread is _____________process that can run independently
heavyweight
lightweight
compaction
compression
Choose THREE(3) benefits of multithreaded processing
scalability
resource sharing
privacy
responsiveness
Execution of a java thread begins on which method call?
Run ()
Start ()
Execute ()
Launch ()
___________distributing task across multiple computing cores
data parallelism
implicit threading
task parallelism
identifying task
Q) Min and Max priority of a thread in Java multithreading are
1, 10
0,10
0,255
1,256
Q) Which method is used to check if a thread is running?
isAlive()
run ()
alive ()
keepAlive()
Q) Execution of a java thread begins on which method call?
Start ()
Run ()
Execute ()
Launch ()
Q) Number of threads in below java program is
public class ThreadExtended extends Thread {
public void run() {
System.out.println("\nThread is running now\n");
}
public static void main(String[] args) {
ThreadExtended threadE = new ThreadExtended();
threadE.start();
}
}
0
1
2
3
Q) What is maximum thread priority in Java
10
12
5
8
Which statements is/are correct
On calling Thread start ( ) method a new thread is created
Thread start( ) method call run( ) method internally
Thread run( ) method can also be called directly to create thread
both a & b
In JAVA multi threading, a thread can be created by_______
Extending class
Implementing Runnable Interface
both
none
Thread priority in Java is?
Integer
Float
Double
Long
Which method is used to get current running thread object?
runningThread()
currentThread()
runnableThread()
None
The life cycle of a thread in java is controlled by
JRE
JDK
JVM
None
Which will contain the body of the thread in Java?
Start()
Run()
Main()
Execute()
Which method is used to make main thread to wait for all child threads
Join ()
Sleep ()
Wait ()
Stop ()
How many ways a thread can be created in Java multithreading?
1
2
5
10
