Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Punkt {
- protected int x;
- protected int y;
- public Punkt() {
- }
- public Punkt(int x, int y) {
- this.x = x;
- this.y = y;
- }
- public Punkt(Punkt p) {
- this.x = p.x;
- this.y = p.y;
- }
- public int pobierzX() {
- return this.x;
- }
- public int pobierzY() {
- return this.y;
- }
- public Punkt pobierzPunkt() {
- Punkt temp = new Punkt();
- temp.ustawXY(this.x, this.y);
- return temp;
- }
- public void ustawX(int x) {
- this.x = x;
- }
- public void ustawY(int y) {
- this.y = y;
- }
- public void ustawXY(int wspX, int wspY) {
- this.x = wspX;
- this.y = wspY;
- }
- public void ustawXY(Punkt pkt) {
- this.x = pkt.x;
- this.y = pkt.y;
- }
- public void wyswietlWspolrzedne() {
- System.out.println("(" + this.x + ", " + this.y + ")");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement