x=$ux; $this->y=$uy; } public function kaugusNullist(){ return sqrt($this->x*$this->x+$this->y*$this->y); } public function kysiX(){ return $this->x; } public function kysiY(){ return $this->y; } public function liiguYles(){ $this->y=$this->y+1; } public function naitaAndmed(){ return "[$this->x, $this->y]"; } } $p=new Punkt(3, 5); echo "sisu: ".$p->kysiY(); echo " kaugus: ".$p->kaugusNullist(); // $p->y=7; //ei saa echo $p->naitaAndmed(); // print_r($p); ?>