public class GreenMartian extends Martian implements Teleporter
Constructor and Description |
---|
GreenMartian(int id)
Creates a GreenMartian with the specified
id and volume is set to 1. |
GreenMartian(int id,
int volume)
Creates a GreenMartian with the specified
id and volume |
Modifier and Type | Method and Description |
---|---|
String |
speak()
Returns a string like:
|
String |
teleport(String dest)
Returns a string like:
|
String |
toString()
Returns a string like:
|
public GreenMartian(int id)
id
and volume is set to 1.id
- public GreenMartian(int id, int volume)
id
and volume
id
- volume
- public String speak()
id=xxx, Grobldy Grockwhere xxx is the
id
public String teleport(String dest)
id=xxx teleporting to dest
where xxx is the id
and dest
is the destination for the teleportationteleport
in interface Teleporter
dest
- This is the destination for the teleportation and is used in the
string that this method returns.