Vidyalelo
Java Programming · Q113

Interfaces and Abstract Classes

Programming · Java Programming · question 113

Q113

What will be the output of the following Java program? 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();

A.
My Thread
B.
Thread[My Thread,5,main]
Answer
C.
Compilation Error
D.
Runtime Error

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board