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 volumeid - volume - public String speak()
id=xxx, Grobldy Grockwhere xxx is the
idpublic String teleport(String dest)
id=xxx teleporting to dest
where xxx is the id and dest is the destination for the teleportationteleport in interface Teleporterdest - This is the destination for the teleportation and is used in the
string that this method returns.