This is my first by-self written code. Looking for advice on what not to or to do so I could deal with any bad habits now. It's a guessing game and works perfectly fine. I just wanted to know if more experienced programmers would see any huge mistakes in the coding style. Basically it generates a number and then asks for the user input. If the two match you win. I tried playing around with arrays, multiple classes and methods and I was curious if there is anything wrong here. Class: GuessGamepackage base;import java.util.Scanner;public class GuessGame {    public static Scanner scanKeyboard = new Scanner(System.in);    public static void main(String[] args) {        Handler gameHandler = new Handler();        System.out.println(Start guessing! You have  + gameHandler.guessLeft +  guesses left.);        System.out.println(gameHandler.goal);        while(!gameHandler.gameOver){            if (gameHandler.guessLeft == 0) {                gameHandler.gameOver = true;                gameHandler.gameOver();            } else if(gameHandler.isGuessRight()){                gameHandler.gameWin();                gameHandler.gameOver = true;            } else{                gameHandler.guessCount++;                System.out.println(Give me your  + gameHandler.guessCount + . guess!);                gameHandler.guesses[gameHandler.guessCount] = scanKeyboard.nextInt();                gameHandler.guessLeft--;                }            }        scanKeyboard.close();        }Class: Handlerpackage base;import java.util.Random;public class Handler {    public int guessLeft = 5;    public int guessCount = 0;    public int[] guesses = new int[guessLeft + 1];    public boolean gameOver = false;    public Random rand = new Random();    public int goal = rand.nextInt(100);    public Handler(){    }    public String PrintGuesses(){        String str =  ;        for(int i = 1; i < guessCount; i++){            str += guesses[i] +  ;        }        return str;    }    public void gameOver(){        System.out.println(You suck!);        System.out.println(The answer was:  + goal);        System.out.println(Your miserable guesses were: + PrintGuesses()+ guesses[guessCount]);    }    public void gameWin(){        System.out.println(You won!);        System.out.println(You guessed it on your  + guessCount + . guess. With the guess  + guesses[guessCount] + .);        System.out.println(Your glorious guesses were: + PrintGuesses() + guesses[guessCount]);    }    public boolean isGuessRight(){        if (guessCount != 0){            if (guesses[guessCount] == goal){                return true;            } else if(guesses[guessCount] < goal){                System.out.println(Too low.);            } else if(guesses[guessCount] > goal){            System.out.println(Too high.);            }        }        return false;    }
High/Low Guessing Game
java;beginner;game;number guessing game
NamingHandler is too generic and doesn't explain what this class is about. GameHandler would be better. Or maybe GameManager even better.Methods should be named camelCase, so this violates the convention: PrintGuessesThe gameOver and gameWin methods' main job is to print messages.So it would be better to name them as such, for example printGameOverMessage, printGameWinMessage.VisibilityA good general rule of thumb:you shouldn't manipulate the fields of objects directly like this: gameHandler.gameOver = trueAll the fields in Handler should be private:They should not be writable by other classesOther classes should not need to see these implementation details This is related to good encapsulation and information hiding:other classes should not need to know how the game handler works,they should be able to interact with it using public interface methods.General coding styleThe formatting is a bit inconsistent. Use your IDE's function to reformat the code nicely and consistently. The empty public constructor of Handler is unnecessary, you can delete it, the compiler will add it automatically