package klassid; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; public class Veebilugemine2 { private int loendur; private StringBuffer vastus; private String aadress; public Veebilugemine2(String aadress){ loeVeebist(aadress); } void loeVeebist(String aadress){ vastus=new StringBuffer(); this.aadress=aadress; try{ BufferedReader br=new BufferedReader(new InputStreamReader(new URL(aadress).openStream())); String rida=br.readLine(); while(rida!=null){ vastus.append(rida+"\n"); rida=br.readLine(); } } catch(Exception ex){ex.printStackTrace();} loendaAlgused(); } void loendaAlgused(){ loendur=0; for(int i=0; i