mercredi 16 janvier 2019

Cant print the value of scan.nextIn();

while(keepGoing)
    {
        while (!scan.hasNextInt() ) 
        {        
            scan.next(); 
            System.out.print('\n'+"Choose a valid number: "); 
        }


        int unitA = scan.nextInt();


        if (unitA < 1) 
        {
            System.out.print('\n'+"Choose one of the options: ");
            keepGoing = true;


        }

        else if (unitA > 14) 
        {
            System.out.print('\n'+"Choose one of the options: ");
            keepGoing = true;

        }

        else
            lengthValue.remove(unitA);
            scan.close();
            keepGoing = false;
    }
    //lengthValue.remove(int unitA);
    System.out.println(unitA);

Im trying to delete the user integer input from an array, but it cant get the value of the input ,please help and thank you! SPAM.inc>> this site keeps asking for more details -_-

Aucun commentaire:

Enregistrer un commentaire