import java.io.*; public class VoostLugeja extends Thread{ BufferedReader sisse; public VoostLugeja(Reader r){ sisse=new BufferedReader(r); } public void run(){ try{ String rida=sisse.readLine(); while(rida!=null){ System.out.println("Loeti "+rida); Thread.sleep(5000); rida=sisse.readLine(); } }catch(Exception e){ e.printStackTrace(); } } }