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 + ")");
    }
    }

  • 相关阅读:
    JDK+MyEclipse+Tomcat配置
    常用数据类型占内存字节数
    连连看核心算法
    gnuplot画图
    socket服务器的搭建-Mac
    AlertController提示框
    block-循环引用
    OC基础(21)
    OC基础(20)
    OC基础(19)
  • 原文地址:https://www.cnblogs.com/acm-icpcer/p/6536304.html
Copyright © 2011-2022 走看看