Demo entry 6686449

df

   

Submitted by anonymous on Dec 23, 2017 at 12:49
Language: Java. Code size: 438 Bytes.

import java.io.*;
public class ThreadTest implements Runnable{
    private String message;
    public static void main(String [] args){
        ThreadTest r = new ThreadTest("Hello");
        Thread t = new Thread(r);
        t.start();
    }
    public ThreadTest(String message){
        this.message = message;
    }
    public void run(){
        while(true){
            System.out.println(message);
        }
    }
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).