Menu
Question Index
...

What is the output of the following program?

public class Locks implements Runnable {
    public void run() {
        int i = 0;;
        while (i < 2) {
            System.out.print("Hai");
            i++;
        }
    }
    public static void main(String... h) {
        Locks locks = new Locks();
        locks.start();
    }
}


HaiHai
Executes without any output
Compilation Error
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