import java.util.Date; public class Hilsen implements Runnable { private static final int REPETIJONER = 10; private static final int DELAY = 1000; private String tekst; public Hilsen(String tekst) { this.tekst = tekst; } public void run() { try { for (int i = 1; i <= REPETIJONER; i++) { System.out.println(new Date() + " " + tekst); Thread.sleep(DELAY); } } catch (InterruptedException e) { } } public static void main(String[] args) { Thread t1 = new Thread(new Hilsen("Hei")); Thread t2 = new Thread(new Hilsen("Hadet")); t1.start(); t2.start(); } }