Menu
Question Index
...

What will be the output of the following program?

public class Madam extends Thread {
    Madam() {
        setName("Gowthami");
        setPriority(MAX_PRIORITY);
    }
    public void run() {
        System.out.println(Thread.currentThread());
    }
    public static void main(String[] args) {
        Madam m = new Madam();
        System.out.println("Thread alive? " + Thread.currentThread().isAlive());
        m.start();
    }
}


Thread alive? false
Thread[Gowthami,10,main]
Thread alive? true
Thread[Gowthami,10,main]
Thread alive? true
Thread[main,5,main]
Some other output
Output can not be determined
Compilation Error or Runtime Error

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