📄 test.java
字号:
// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -