Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Punkt {
- public int x, y;
- //private int x, y;
- //konstruktor
- Punkt(){
- x = 0;
- y = 0;
- }
- Punkt(int a, int b){
- x = a;
- y = b;
- }
- void wyswietl() {
- System.out.println(x + ", " + y);
- }
- int getx() {
- return x;
- }
- int gety() {
- return y;
- }
- void setxy(int nowyx, int nowyy) {
- x = nowyx;
- y = nowyy;
- }
- void ustawxy(Punkt nowy) {
- x = nowy.x;
- y = nowy.y;
- }
- Punkt pobierzWsp() {
- Punkt nowy = new Punkt();
- nowy.x = x;
- nowy.y = y;
- return nowy;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement