Starter Code for Number Guessing Game

import java.util.ArrayList;
import javax.swing.JOptionPane;

public class GuessingGame {

    ////// ADD CODE HERE, AS NEEDED /////
    private int numGuesses_;                          
    private int guess_ = -1;                          
    private ArrayList<String> stillPossibleValues_;   
    

    public GuessingGame ( ) {
        //// ADD CODE HERE ////                                                    
    }

    public int myGuessIs() {
        //// ADD CODE HERE ////
        //// returning -1 if the player made a mistake -- see the main() method
    }
    
    public int totalNumGuesses() {
        //// ADD CODE HERE //// 
        //// to return the total number of guesses taken        
    }
 
    public void updateMyGuess(int nmatches) {
        //// ADD CODE HERE ////
        //// to update the guess based on the number of 
        //// matching digits claimed by the user
    }
    
    //// ADD MORE METHODS HERE, AS NEEDED
    


    // DO NOT CHANGE THE MAIN FUNCTION
    public static void main(String[] args) {

        GuessingGame gamer = new GuessingGame( );
  
        JOptionPane.showMessageDialog(
              null, 
              "Think of a number between 1000 and 9999.\n Click OK when you are ready...", 
              "Let's play a game", 
              JOptionPane.INFORMATION_MESSAGE);
        int numMatches = 0;
        int myguess = 0;
        
        do {
            myguess = gamer.myGuessIs();
            if (myguess == -1) {
                JOptionPane.showMessageDialog(
                      null, 
                      "I don't think your number exists.\n I could be wrong though...", 
                      "Mistake", 
                      JOptionPane.INFORMATION_MESSAGE);
                System.exit(0);
            }
            String userInput = JOptionPane.showInputDialog(
                      "I guess your number is " + myguess + 
                      ". How many digits did I guess correctly?");
            // quit if the user input nothing (such as pressed ESC)
            if (userInput == null)
                System.exit(0);
            // parse user input, pop up a warning message if the input is invalid
            try {
                numMatches = Integer.parseInt(userInput.trim());
            }
            catch(Exception exception) {
                JOptionPane.showMessageDialog(
                       null, 
                       "Your input is invalid. Please enter a number between 0 and 4", 
                       "Warning", 
                       JOptionPane.WARNING_MESSAGE);
                continue;
            }
            // the number of matches must be between 0 and 4
            if (numMatches < 0 || numMatches > 4) {
                JOptionPane.showMessageDialog(
                       null, 
                       "Your input is invalid. Please enter a number between 0 and 4", 
                       "Warning", 
                       JOptionPane.WARNING_MESSAGE);
                continue;
            }
            if (numMatches == 4)
                break;
            // update based on user input
            gamer.updateMyGuess(numMatches);
            
        } while (true);
        
        // the game ends when the user says all 4 digits are correct
        System.out.println("Aha, I got it, your number is " + myguess + ".");
        System.out.println("I did it in " + gamer.totalNumGuesses() + " turns.");
    }
}