Menu
Question Index
...

What will be the output of the following program?

class RunnableTest extends java.util.Vector implements Runnable { // LINE A
    public void run() { // LINE C
        System.out.println("Run Method");
    }
}
public class Test {
    public static void main(String[] args) {
        Runnable obj = new RunnableTest(); // LINE D
        Thread t = new Thread(obj); // LINE B
        t.start();
    }
}


Run Method
Compile time Error at LINE A
Compile Error at LINE B because we can not pass parameter to Thread
Compile time Error at LINE C
Run time Error at LINE D

Doubts

Problems

Topic: What is Multitasking and Multithreading?

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App