Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum Move {
- ROCK, PAPER, SCISSORS;
- }
- class Hand {
- Move currentMove;
- public void setMove(Move currentMove) {
- this.currentMove = currentMove;
- }
- public void printCurrentMove() {
- System.out.println(currentMove);
- }
- }
- public class Program {
- public static void main(String args[]) {
- Hand alex = new Hand();
- Hand jared = new Hand();
- alex.setMove(Move.ROCK);
- alex.printCurrentMove();
- jared.setMove(Move.PAPER);
- jared.printCurrentMove();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement