listpoint.java

来自「Java2入门经典第二章源码」· Java 代码 · 共 31 行

JAVA
31
字号
public class ListPoint
{
  // Constructor 
  public ListPoint(Point point)
  {
    this.point = point;            // Store point reference
    next = null;                   // Set next ListPoint as null
  }

  // Set the pointer to the next ListPoint
  public void setNext(ListPoint next)
  {
    this.next = next;              // Store the next ListPoint
  }

  // Get the next point in the list
  public ListPoint getNext()
  {
    return next;                   // Return the next ListPoint
  }

  // Return String representation
  public String toString()
  {
    return "(" + point + ")";
  }

   private ListPoint next;         // Refers to next ListPoint in the list
   private Point point;            // The point for this list point
}

⌨️ 快捷键说明

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