test.java

来自「Corejava」· Java 代码 · 共 27 行

JAVA
27
字号
//  Test.java
// Point类测试程序
import javax.swing.JOptionPane;
//import com.deitel.jhtp3.ch09.Point;

public class Test {
   public static void main( String args[] )
   {
      Point p = new Point( 72, 115 );
      String output;

      output = "X coordinate is " + p.getX() +
               "\nY coordinate is " + p.getY();

      p.setPoint( 10, 10 );

      // 使用隐含引用 p.toString()
      output += "\n\nThe new location of p is " + p;

      JOptionPane.showMessageDialog( null, output,
         "Demonstrating Class Point",
         JOptionPane.INFORMATION_MESSAGE );
      System.exit( 0 );
   }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?