Which two are true?

Given: Which two are true?

Given: Which two are true?

A.
No output is produced

B.
No new threads of execution are started within the main method

C.
Two new threads of exclusion are started within the main method

D.
Thread is printed

E.
Runnable is printed

F.
One new thread of execution is started within the main method



Leave a Reply 2

Your email address will not be published. Required fields are marked *


bob

bob

B is wrong, F seems the good one instead.

duff

duff

The code is bot compilable 🙁
There are no static method start() in Thread class.
may be
t.start() instead?
if so – then A and F.

Code to check below:
public class SuperThread extends Thread {

public void run() {
System.out.println(“tun”);
super.run();

}

public void run(String s) {
System.out.println(“Thread”);
}

public void run(Runnable r) {
r = new Runnable() {
@Override
public void run() {
System.out.println(“Runnable”);
}
};
}

public static void main(String[] args) {
Thread t = new SuperThread();
t.start();
}
}