How to build a simple game in java that will allow a player to attempt to guess a randomly generated number between 0 and 10. The player can continue guessing the number until they get it right.

The game should be able to do these things:
1. Game should remember each choice that the player enters.
2. Each time the player gets the guess wrong you should tell the to try again.
3. If the player guesses correctly tell them so.
4. The game should then print out all the values that the player entered, in the order in which they were entered.
5. Once they’ve guessed the correct number and seen their list of guesses, they can play again, but only five (5) times.

import java.util.Scanner;

public class GuessNumberUsingBreak {
public static void main(String[] args) {
int number = (int)(Math.random() * 101);
System.out.println(number);
Scanner input = new Scanner(System.in);
while (true) {
// Prompt the user to guess the number
System.out.print("Guess a number between 0 ad 100.\nEnter your guess: ");
int guess = input.nextInt();

if (guess == number) {
System.out.println("Congratulations! " +
"You have chosen the correct number! \nThe correct number is " + number);
break;
}
else if (guess > number) {
System.out.println("Your guess is too high");
}
else {
System.out.println("Your guess is too low");
}
}
}
}

To build a simple game in Java that allows a player to guess a randomly generated number between 0 and 10, while fulfilling all the requirements mentioned, you can follow these steps:

1. Import the necessary Java classes:
```java
import java.util.Random;
import java.util.ArrayList;
import java.util.Scanner;
```

2. Define the main game function:
```java
public static void main(String[] args) {
int numberOfAttempts = 5;
boolean playAgain = true;

while (playAgain) {
ArrayList<Integer> guesses = new ArrayList<>();
int randomNumber = generateRandomNumber(0, 10);
boolean guessedCorrectly = false;

System.out.println("Guess the number between 0 and 10!");

while (numberOfAttempts > 0 && !guessedCorrectly) {
int playerGuess = getPlayerGuess();
guesses.add(playerGuess);

if (playerGuess == randomNumber) {
guessedCorrectly = true;
System.out.println("Congratulations! You guessed the correct number.");
System.out.println("Here are your guesses: " + guesses);
} else {
System.out.println("Wrong guess. Try again.");
numberOfAttempts--;
}
}

if (!guessedCorrectly) {
System.out.println("Out of attempts. The correct number was: " + randomNumber);
}

numberOfAttempts = 5; // Reset the number of attempts for the next game

if (!playAgain()) {
playAgain = false;
}
}
}
```

3. Implement the helper methods:

- A method to generate a random number between 0 and 10:
```java
public static int generateRandomNumber(int min, int max) {
Random random = new Random();
return random.nextInt((max - min) + 1) + min;
}
```

- A method to get the player's guess:
```java
public static int getPlayerGuess() {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter your guess: ");
return scanner.nextInt();
}
```

- A method to prompt the player if they want to play again:
```java
public static boolean playAgain() {
Scanner scanner = new Scanner(System.in);
System.out.print("Would you like to play again? (yes/no): ");
String answer = scanner.nextLine().toLowerCase();

return answer.equals("yes");
}
```

By following these steps, you will have built a simple game in Java that meets the given requirements. The game allows the player to guess a randomly generated number and continues until they guess it correctly or run out of attempts. It tracks the player's guesses, displays them when they guess correctly, and allows the player to play again up to five times.