Programming Language Java thread MCQ Question #2297
Single Choice Not Set

QWhat will happen when you attempt to compile and run the following code?
1. public class Test extends Thread{
2.       public static void main(String argv[]){
3.             Test t = new Test();
4.             t.run();
5.             t.start();
6.       }
7.       public void run(){
8.             System.out.println("run-test");
9.       }
10. }

ID: #2297 Java thread MCQ 3,409 views
Question Info
#2297Q ID
Not SetDifficulty
Java thread MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A run-test run-test
  • B run-test
  • C Compilation fails due to an error on line 4
  • D Compilation fails due to an error on line 7
Correct Answer

Explanation

run-test run-test

Share This Question

Challenge a friend or share with your study group.