Class HighScore
java.lang.Object
|
+--HighScore
- public class HighScore
- extends java.lang.Object
HighScore is a score obtained by a user which is high enough to be amongst
the top 15 scores. A HighScore consists of the score and the name of the
user who achieved that score.
Constructor Summary |
HighScore(java.lang.String name,
int score)
Constructor for the Score Class |
Method Summary |
java.lang.String |
getName()
Returns the user's name |
int |
getScore()
Returns the user's score |
void |
setName(java.lang.String name)
Sets the user's name to the passed value |
void |
setScore(int score)
Sets the user's score to the passed value |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HighScore
public HighScore(java.lang.String name,
int score)
- Constructor for the Score Class
- Parameters:
name
- the name of a userscore
- the score of a user
getName
public java.lang.String getName()
- Returns the user's name
- Returns:
- the name of the user
setName
public void setName(java.lang.String name)
- Sets the user's name to the passed value
- Parameters:
name
- the name of the user
getScore
public int getScore()
- Returns the user's score
- Returns:
- the score of the user
setScore
public void setScore(int score)
- Sets the user's score to the passed value
- Parameters:
score
- the value to set the user's score to