public class TestThread2{ public static void main (String[] args) { new Thread(new PingPong("ping", 33)).start(); // 1/30s new Thread(new PingPong("PONG",100)).start(); // 1/10s System.out.println("Kraj main funkcije"); } } class PingPong implements Runnable { public String rec; int vreme;PingPong(String r, int v){ rec=r; vreme=v; } public void run(){ try{ for(int i=0;i<20;i++){ System.out.print(rec + ": " + i + "\n"); Thread.sleep(vreme);} } catch(InterruptedException e){ return; } } }