Exception in thread “main” java.util.InputMismatchException

前端 未结 2 1075
醉梦人生
醉梦人生 2020-11-30 14:10

i need help with one exercise in java, i\'m stuck on this error 2 hours maybe. Any help would be great.

Exception in thread \"main\" java.util.InputMismatch         


        
2条回答
  •  一向
    一向 (楼主)
    2020-11-30 14:44

    This Exception Thrown by a Scanner to indicate that the token retrieved does not match the pattern for the expected type, or that the token is out of range for the expected type.

    String imer = input.next();// Use for String Input
    input.nextLine();//Use for next line of input
    int cenar = input.nextInt();
    

提交回复
热议问题