
PAZ1c
•public class Bod {
–protected double
x;
–protected double
y;
–
–public Bod(double x,
double y) {
– this.x = x;
– this.y = y;
–}
–//..gettery a
settery
•}
–
•Bod b = new Bod(25.0, -3.0);
ušetrili sme dva riadky, a je to prehľadnejšie
Dedenie konštruktorov