Which two are true?

Given:

Which two are true?

Given:

Which two are true?

A.
Thread is printed

B.
Runnable is printed

C.
No output is produced

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

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

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

Explanation:



Leave a Reply 5

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


Tim

Tim

It should be C E, given “start();” modified to “t.start();” (otherwise compilation fails).

l0c

l0c

Indeed, while the SuperThread’s run()-method prints nothing (note that the run() from Thread is not correctly overridden in SuperThread), the thread is in fact started. So there is one new thread of execution and no output.

Klyaksa

Klyaksa

Program does not compile because non-static method cannot be called from static method.