Sunday, March 4, 2012

Nokia Written Test Question

What is the output of following code:

public class ThreadTest1 implements Runnable{

    public static void main(String args[])throws Exception{

        Thread t1 = new Thread(new ThreadTest1());

        t1.start();
        System.out.println("Begin");
        t1.join();
        System.out.println("End");
    }

    public void run(){
        System.out.println("Run");
    }
}

No comments:

Post a Comment