?? golfball.java
字號:
class Golfball
{
private MyStringBuffer brand;
private MyStringBuffer make;
private int compression;
public Golfball (MyStringBuffer str,
MyStringBuffer mk, int comp)
{
brand = str;
make = mk;
compression = comp;
}
public MyStringBuffer brand()
{
return brand;
}
public MyStringBuffer make()
{
return make;
}
public int compression()
{
return compression;
}
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj != null && getClass() == obj.getClass())
{
Golfball gb = (Golfball)obj; //Classes are equal, downcast.
if (brand.equals(gb.brand()) && //Compare attributes.
make.equals(gb.make()) &&
compression == gb.compression())
{
return true;
}
}
return false;
}
//...
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -