I made a Rock, Paper, Scissors game and would like the code to be reviewed.Main class:public class Main {    public static void main(String args[]){        Game game = new Game();        game.gameLoop();    }}Game class:import java.util.Scanner;public class Game {String yesOrNo;Input inputClass = new Input();Computer comp = new Computer();Checking checker = new Checking();Score score = new Score();Scanner input = new Scanner(System.in);    public void gameLoop() {        while (true) {            inputClass.setUserInput();            comp.setComputerInput();            comp.displayComputerInout();            if (checker.check(inputClass.getUserInput(),                    comp.getComputerInput()) == 0) {                System.out.println(Tie!);                score.scoreBoard(0);            } else if (checker.check(inputClass.getUserInput(),                    comp.getComputerInput()) == 1) {                System.out.println(Win!);                score.scoreBoard(1);            } else if (checker.check(inputClass.getUserInput(),                    comp.getComputerInput()) == 2) {                System.out.println(Lose);                score.scoreBoard(2);            } else if (checker.check(inputClass.getUserInput(),                    comp.getComputerInput()) == -1) {                break;            }            System.out.println(Go to score menu? y/n);            yesOrNo = input.nextLine();            if(yesOrNo.equals(y)){                score.ScoreMenu();            }else if(yesOrNo.equals(n)){            }else{                System.out.println(Invalid command! Continuing without going to score menu!);            }            System.out.println(Want to play again? y/n);            yesOrNo = input.next();            if(yesOrNo.equals(y)){            }else if(yesOrNo.equals(n)){                break;            }else{                System.out.println(Invalid command! Continuing!);            }        }    }}Input Class:import java.util.Scanner;public class Input {    private Scanner input = new Scanner(System.in);    private int uInput;    public void setUserInput(){        System.out.println(Rock: 1, Paper: 2, Scissor: 3);        uInput = input.nextInt();        if(uInput<1 || uInput>3){            System.out.println(Invalid value!\nYou get Rock);            uInput=1;        }    }    public int getUserInput(){        return uInput;    }}Computer Class: public class Computer {    private int computerGesture;    public void setComputerInput(){        computerGesture = (int) (Math.random()*4);        if(computerGesture == 0){            computerGesture = 1;        }    }    public int getComputerInput(){        return computerGesture;    }    public void displayComputerInout(){        if(computerGesture == 1)        {            System.out.println(Computer chooses rock);        }else if(computerGesture == 2){            System.out.println(Computer chooses paper);        }else if(computerGesture == 3){            System.out.println(Computer chooses scissor);        }    }}Checking Class:public class Checking {    private final int TIE = 0;    private final int WIN = 1;    private final int LOSE = 2;    private final int ERROR = -1;    public int check(int pGesture, int cGesture) {        if (pGesture == cGesture) {            return TIE;        } else if (pGesture == 1 && cGesture == 2) {            return LOSE;        } else if (pGesture == 2 && cGesture == 1) {            return WIN;        } else if (pGesture == 1 && cGesture == 3) {            return WIN;        } else if (pGesture == 3 && cGesture == 1) {            return LOSE;        } else if (pGesture == 2 && cGesture == 3) {            return LOSE;        } else if (pGesture == 3 && cGesture == 2) {            return WIN;        } else {            return ERROR;        }    }}Score Class:import java.util.Scanner;public class Score {    Scanner input = new Scanner(System.in);    private int wins = 0;    private int loses = 0;    private int ties = 0;    private String choise;    public void scoreBoard(int winOrLoseOrTie){        if(winOrLoseOrTie == 1){            wins++;        }else if(winOrLoseOrTie == 2){            loses++;        }else if(winOrLoseOrTie == 0){            ties++;        }    }    public void displayScore(){        System.out.println(Wins Loses Ties\n+wins+    +loses+    +ties);    }    public void resetScoreBoard(){        wins = 0;        loses = 0;        ties = 0;    }    public void ScoreMenu(){        System.out.println(Display Score: display);        System.out.println(Reset Score: reset);        System.out.println(Exit score menu: exit);        choise = input.next();        if(choise.equals(display)){            displayScore();        }else if(choise.equals(reset)){            resetScoreBoard();        }else if(choise.equals(exit)){        }else{            System.out.println(Invalid command!);            ScoreMenu();        }    }}
Rock, Paper, Scissors Game in Java
java;game;rock paper scissors
I will not cover the style convention, but do know that there is work to do !Empty ifYou should never use empty if. This would to someone thinking that the if is not necessary, remove it and bang your program doesn't work anymore.     if(choise.equals(display)){        displayScore();    }else if(choise.equals(reset)){        resetScoreBoard();    }else if(choise.equals(exit)){    }else{        System.out.println(Invalid command!);        ScoreMenu();    }In this case you could add a return, since that is basically what you want to do.EnumsWhen you have a set of predefined values with a meaning, normally you can make a Enum to give them the special meaning they deserve and enhance the readability of the code. private final int TIE = 0;private final int WIN = 1;private final int LOSE = 2;private final int ERROR = -1;This could be public enum GameEnding {    TIE , WIN , LOSE , ERROR}The name is really bad, but with an enum your method to check will be far more readable :    if(winOrLoseOrTie == GameEnding.WIN){        wins++;    }else if(winOrLoseOrTie == GameEnding.LOSE){        loses++;    }else if(winOrLoseOrTie == GameEnding.TIE){        ties++;    } Now instead of having magic numbers, you have a readable way to express the outcome of a game.OO structureI didn't read for a long time your code, but I can say that you're on the good way. You've encapsulated your Game, Scoring and concept like that. You still use some magic numbers, which is an indication that there are some concept of your game that you have not abstracted in code. The GameEnding enum is one of those concept. It has a specific meaning in your application and will be used everywhere in your code, that should have been there, but this will come with more experience.This is a bit advance for you (I guess), but your output should be independent of your logic code. This will help to separate your concepts , because when you'll move from the console to a GUI, all your classes will be impacted. There is still an Enum missing in your code, I will leave it as an exercise to you, but some tips look at magic numbers and think of what is the base of Rock, Paper, Scissors!