Menu
Topics Index
...
`

NewName


If you need explanation Read this topic

If you need Answer Take test on this topic

NewName
What will be the output of the following program?
public class NewName extends Thread {
    public void run() {
        System.out.println("Starting point");
        yield();
        System.out.println("Ending point");
    }
    public static void main(String[] argv) {
        (new NewName()).start();
    }
}

A. Starting point
B. Ending point
C. Starting point
Ending point
D. (No output)
E. Compilation Error or Runtime Error
Topic: What is Multitasking and Multithreading?

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

c is answer since first sop in run is invoked with the  start and then sop beneath yeild method

Posted by Karteek Paruchuri    2013-06-18 08:42:13


answer is c bcoz yield function causes thread to pause for som tym n tries to execute other threads..bt der r no other threads..so after som tym execution continues and prints output as shown in option c

Posted by Pramod Jain    2013-06-18 08:42:26


@santosh munugota  u can have anything in the place of args/argv we can have dailydose too
check this http://www.coderanch.com/t/392921/java/java/args-argv

Posted by Karteek Paruchuri    2013-06-18 08:59:48


@karteek paruchuri:i mistuk () as {} that is y the put the code btw i know u can put anything in place of args its just a variable indeed :)

Posted by Santosh Munugota    2013-06-18 09:56:20


Congratulations Karteek Paruchuri. You are this dose winner. Please send us your mobile details and we will process the recharge asap.

Posted by Merit Campus    2013-06-18 15:07:28


got the rc thankyou

Posted by Karteek Paruchuri    2013-06-24 08:02:20


© meritcampus 2019

All Rights Reserved.

Open In App