xypoint-javadoc.html

来自「经典的数据结构源代码(java 实现)」· HTML 代码 · 共 46 行

HTML
46
字号
<html><head><title>Code Fragment</title></head><body text=#000000><center></center><br><br><dl><dd><pre><font color=#ff0080>/** * This class defines an immutable (x,y) point in the plane. * * @author Michael Goodrich */</font><font color=#8000a0>public</font> <font color=#8000a0><font color=#ff8000>class</font> </font>XYPoint {  <font color=#8000a0><font color=#8000a0>private</font> </font><font color=#8000a0>double</font> x,y; <font color=#ff0080>// private instance variables for the coordinates</font>  <font color=#ff0080>/**   * Construct an (x,y) point at a specified location.   *   * @param xCoor The x-coordinate of the point   * @param yCoor The y-coordinate of the point   */</font>  <font color=#8000a0><font color=#8000a0>public</font> </font><font color=#0000ff>XYPoint</font>(<font color=#8000a0>double</font> xCoor, <font color=#8000a0><font color=#8000a0>double</font> </font>yCoor) {    x = xCoor;    y = yCoor;  }  <font color=#ff0080>/**   * Return x-coordinate value.   *   * @return x-coordinate   */</font>  <font color=#8000a0><font color=#8000a0>public</font> </font><font color=#8000a0>double</font> <font color=#0000ff>getX</font>() { <font color=#8000a0><font color=#ff8000>return</font> </font>x; }  <font color=#ff0080>/**   * Return y-coordinate value.   *   * @return y-coordinate   */</font>  <font color=#8000a0><font color=#8000a0>public</font> </font><font color=#8000a0>double</font> <font color=#0000ff>getY</font>() { <font color=#8000a0><font color=#ff8000>return</font> </font>y; }}</dl></body></html>

⌨️ 快捷键说明

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