Java Thread Hello World Demo.


public class DemoThread {
    public static class MyThread extends Thread {
        public void run() {
            System.out.println("Hello World");
        }
    }
    public static void main(String[] args) {
        Thread myThread = new MyThread();
        myThread.start();
    }
}

Output:
Hello World


Share on Google Plus

About Ram Pukar

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment

0 comments:

Post a Comment