public class TennisBall
extends java.lang.Object
| 构造器和说明 |
|---|
TennisBall(int ttl)
Creates a new ball with the specified TTL (Time To Live) value.
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getTTL() |
TennisBall |
stroke() |
java.lang.String |
toString() |
public TennisBall(int ttl)
ttl - The time to livepublic int getTTL()
public TennisBall stroke()
TennisPlayer's stroke.
The returned ball has decreased TTL value and switched PING/PONG state.public java.lang.String toString()
toString 在类中 java.lang.Object[PING|PONG]
(TTL)).