ThreadDemo.java Source code

Java tutorial

Introduction

Here is the source code for ThreadDemo.java

Source

class ThreadDemo implements Runnable {
    Thread t;

    ThreadDemo() {
        t = new Thread(this);

        t.start();
    }

    public void run() {

        System.out.println(t.toString());
    }

}

public class Main {

    public static void main(String[] args) {
        new ThreadDemo();
    }

}