?? flea.java
字號:
public class Flea extends Animal implements Cloneable
{
// Constructor
public Flea(String aName, String aSpecies)
{
super("Flea"); // Pass the type to the base
name = aName; // Supplied name
species = aSpecies; // Supplied species
}
// Change the flea's name
public void setName(String aName)
{
name = aName; // Change to the new name
}
// Return the flea's name
public String getName()
{
return name;
}
// Return the species
public String getSpecies()
{
return species;
}
public void sound()
{
System.out.println("Psst");
}
// Present a flea's details as a String
public String toString()
{
return super.toString() + "\nIt's " + name + " the " + species;
}
// Override inherited clone() to make it public
public Object clone() throws CloneNotSupportedException
{
return super.clone();
}
private String name; // Name of flea!
private String species; // Flea species
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -