zoukankan      html  css  js  c++  java
  • 14

    package arraylistlearning;

    import java.awt.*;

    public class PointTester {
    public static void main(String[] arguments) {
    Point location1 = new Point(11,22);
    Point3D location2 = new Point3D(7,6,64);

    System.out.println("The 2D point is at (" + location1.x
    + ", " + location1.y + ")");
    System.out.println("It's being moved to (4, 13)");
    location1.move(4,13);
    System.out.println("The 2D point is now at (" + location1.x
    + ", " + location1.y + ")");
    System.out.println("It's being moved -10 units on both the x "
    + "and y axes");
    location1.translate(-10,-10);
    System.out.println("The 2D point ends up at (" + location1.x
    + ", " + location1.y + ") ");

    System.out.println("The 3D point is at (" + location2.x
    + ", " + location2.y + ", " + location2.z + ")");
    System.out.println("It's being moved to (10, 22, 71)");
    location2.move(10,22,71);
    System.out.println("The 3D point is now at (" + location2.x
    + ", " + location2.y + ", " + location2.z + ")");
    System.out.println("It's being moved -20 units on the x, y "
    + "and z axes");
    location2.translate(-20,-20,-20);
    System.out.println("The 3D point ends up at (" + location2.x
    + ", " + location2.y + ", " + location2.z + ")");
    }
    }

  • 相关阅读:
    Code::blocks 使用c++ long double类型出错
    数论四大定理
    线性基
    win7 下强制删除文件
    C++数组指针的引用
    学习方法
    MySQL的ON DUPLICATE KEY UPDATE用法
    MVCC
    RabbitMQ中的Connection 和 Channel
    myisam和innodb的比较
  • 原文地址:https://www.cnblogs.com/acm-icpcer/p/6536304.html
Copyright © 2011-2022 走看看