Posted by Lisa on Monday, October 26, 2009 at 4:15pm.
A service class emulates the actual operation of the service you are trying to provide.
For a player, you would think of what he needs to do, for example:
initialize player (name, credit card number, etc.)
choose preferences (type of game, throw first or second, etc.)
start a game
decide on amount of bet
throw dice
keep score/winnings
quit game
So you will need to provide methods for all these and probably other activities, including other private methods that are required to provide information to the public methods (get/set methods, etc.)
Depending on what services you will need, you will establish the state variables, which are usually private.
Hope this gets you started, and post if you have comments or questions.
Related Questions
Computer Science-Java - Hi, I am writing an application class for a Lunar ...
Computer Science - Could someone show me an example of a service class that ...
Computer Science Java - I have to write program for a dice game and use a ...
computer science - Hi, I have this quick question: A Java interface can be used ...
Computer Science - Consider the following application files: /JavaCS1/src/...
English - 1. My favorite class is a math class. 2. My favorite class is math ...
COMPUTER SCIENCE JAVA - Assignment problems: Write Java programs for each of the...
COMPUTER SCIENCE JAVA - Assignment problems: Write Java programs for each of the...
Math/algebra class - You live 15 blocks (3/4 of a mile) from RACC. Your car is ...
Computers(Java Programming) - Service Class: Lottery Write a Lottery class that ...
For Further Reading