阅读背景:

提示用户,直到输入正确的输入类型

来源:互联网 
while (goodInput=false)
        {
            try
            {
                System.out.println("How long is the word you would like to guess?");
                wordSize=scan.nextInt();
                while(wordSize>word.longestWord())
                {
                    System.out.println("There are no words that big! Please enter another number");
                    wordSize=scan.nextInt();
                }
                goodInput=true;
            }
            catch(InputMismatchException ime)
            {
                System.out.println("Thats not a number! Try again");
            }

        }
while (goodInput=false)
        {
            t



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: