import java.io.*; import java.net.*; public class Epp1{ public static void main(String argumendid[]) throws IOException{ ServerSocket ss=new ServerSocket(3001); while(true){ new Epuloim(ss.accept()); } } } class Epuloim extends Thread{ Socket sc; public Epuloim(Socket usc){ sc=usc; start(); } public void run(){ try{ PrintWriter valja=new PrintWriter(sc.getOutputStream(), true); BufferedReader sisse=new BufferedReader( new InputStreamReader(sc.getInputStream())); valja.println("Fail palun!"); String nimi=sisse.readLine(); valja.println("Kirjuta oma t„isnimi!"); String nimi1=sisse.readLine(); valja.println("Kirjuta oma telefoninumber!"); String tel=sisse.readLine(); valja.println("Kirjuta oma aadress!"); String aad=sisse.readLine(); PrintWriter faili=new PrintWriter(new FileWriter(nimi, true)); faili.println(nimi1); faili.println(tel); faili.println(aad); faili.close(); sc.close(); }catch(Exception e){ System.out.println("Probleem "+e); } } }