Question about InputMismatchException while using Scanner

后端 未结 5 1786
一整个雨季
一整个雨季 2021-01-23 08:50

The question :

Input file: customer’s account number, account balance at beginning of month, transaction type (withdrawal, deposit, in

5条回答
  •  佛祖请我去吃肉
    2021-01-23 09:50

    If you read the Exception messages, it's an InputMismatchException. This is highly likely caused by the nextDouble() or nextInt() function, when it's not reading the correct type. Make sure your data is aligned correctly, and you're not reading doubles with readInt().

提交回复
热议问题