Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class GameEntry
- {
- private String name;
- private int score;
- public GameEntry(String name, int score)
- {
- setName(name);
- setScore(score);
- }
- public String getName()
- {
- return this.name;
- }
- public void setName(String name)
- {
- this.name = name;
- }
- public int getScore()
- {
- return this.score;
- }
- public void setScore(int score)
- {
- this.score = score;
- }
- public String toString()
- {
- return this.name + " , " + this.score;
- }
- public static void main(String[] args)
- {
- GameEntry Kitz = new GameEntry("Kitz", 100);
- System.out.println(Kitz.toString());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement