Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //main.java
- package teszt;
- import geom.Pont;
- public class Teszt {
- public static void main(String[] args) {
- System.out.println("Hello vilag!");
- Pont p1 = new Pont(3,5);
- //System.out.println("(" + p1.x + "," + p1.y + ")");
- System.out.println("(" + p1.getX() + "," + p1.getY() + ")");
- p1.setX(-3);
- System.out.println("(" + p1.getX() + "," + p1.getY() + ")");
- }
- }
- //pont.java
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package geom;
- /**
- *
- * @author hallgato
- */
- public class Pont{
- private int x;
- private int y;
- //public Pont(){}
- public Pont(int x, int y) {
- this.x = x;
- this.y = y;
- }
- public int getX() {
- return x;
- }
- public int getY() {
- return y;
- }
- public void setX(int x) {
- this.x = x;
- }
- public void setY(int y) {
- this.y = y;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement