public class TennisBall
extends java.lang.Object
构造器和说明 |
---|
TennisBall(int ttl)
Creates a new ball with the specified TTL (Time To Live) value.
|
限定符和类型 | 方法和说明 |
---|---|
int |
getTTL()
Returns the TTL value of this ball.
|
TennisBall |
stroke()
Returns the ball after
TennisPlayer 's stroke. |
java.lang.String |
toString()
Returns string representation of this message (
[PING|PONG]
(TTL) ). |
public TennisBall(int ttl)
public 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()
[PING|PONG]
(TTL)
).toString
在类中 java.lang.Object