|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectanimals.Bunny
public class Bunny
A Bunny rabbit with a name. It eats carrots.
| Field Summary | |
|---|---|
int |
carrotCount
how many carrots total the Bunny has eaten |
java.lang.String |
name
Bunny's name |
| Constructor Summary | |
|---|---|
Bunny()
|
|
| Method Summary | |
|---|---|
void |
feed(int numcarrots)
feed carrots to the bunny |
void |
hop()
hop into the air. |
void |
marchMadness()
run around like crazy |
void |
sayHi()
print a hello message |
java.lang.String |
toString()
creates String representing the Bunny whenever a Bunny is implicitly cast to a String println calls this automagically |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public java.lang.String name
public int carrotCount
| Constructor Detail |
|---|
public Bunny()
| Method Detail |
|---|
public void sayHi()
public void feed(int numcarrots)
numcarrots - the number of carrots it eatspublic void hop()
public void marchMadness()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||