⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mygolfball.java

📁 PracticalJAVACode 的源码
💻 JAVA
字号:
class MyGolfball extends Golfball
{
  public final static byte TwoPiece = 0;
  public final static byte ThreePiece = 1;
  private byte ballConstruction;



  public MyGolfball(String str, String mk,
                    int comp, byte construction)
  {
    super(str, mk, comp);
    ballConstruction = construction;
  }

  public byte construction()
  {
    return ballConstruction;
  }

  public boolean equals(Object obj)
  {
    if (this == obj)
      return true;

    if (obj != null && getClass() == obj.getClass())
    {
      MyGolfball gb = (MyGolfball)obj;  //Class equal, downcast.
      if (ballConstruction == gb.construction())
        return true;
    }
    return false;
  }
}

⌨️ 快捷键说明

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