public class Hoidla2{ T p1, p2; public Hoidla2(T up1, T up2){ p1=up1; p2=up2; } public double kaugus(){ return p1.distance(p2); } public String toString(){ return "("+p1+", "+p2+")"; } }