Witam,
public class Point {
double wsp1;
double wsp2;
Point (double wsp1, double wsp2) {
this.wsp1 = wsp1;
this.wsp2 = wsp2;
String nazwa_klasy = "<Point>{(" + wsp1 + "," + wsp2 + ")}";
}
void Area () {
System.out.println(" Area=" + 0);
}
void Len () {
System.out.println(" Len=" + 0);
}
void Count () {
System.out.println(" Count=" + 1);
}
}
public class UJZad1 {
public static void main(String[] args) {
Point p = new Point(12,11);
System.out.println(p);
}
}
zależy mi aby zamiast:
ujzad1.Point@190d11
System.out.println(p) wyświetlił wartość nazwa_klasy czyli:
<Point>{(12.0,11.0)}
Reasumując jak oszukać System.out.println(p)?