Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Point;
- public class Point
- {
- private double x, y;
- public double getX()
- {
- return this.x;
- }
- public double getY()
- {
- return this.y;
- }
- public Point(double nx, double ny)
- {
- x = nx;
- y = ny;
- }
- public double sumupANDIncreaseBy(double dx)
- {
- return ++this.x + ++this.y + ++dx;
- }
- public static void main(String[] args)
- {
- Point p1 = new Point(3, 3);
- double r = 5;
- System.out.println("p1.x = " + p1.getX() + ", p1.y = " +
- p1.getY() + "; " + "p1.sumupANDIncreaseBy(r) results in " +
- p1.sumupANDIncreaseBy(5)+ ", p1.x = " + p1.getX() + ", p1.y = "
- + p1.getY() + ", r = " + r);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement