public class Loim3{ public static void main(String argumendid[]) throws Exception{ Thread nr=new Numbrid(); nr.start(); Thread.sleep(2000); System.out.println("Ootan, kuni numbrid loetud"); nr.join(); System.out.println("Ongi loetud, saab muud edasi teha"); } } class Numbrid extends Thread{ public void run(){ for(int i=0; i<10; i++){ System.out.println(i); try{ Thread.sleep(1000); }catch(Exception e){} } } }