Question about InputMismatchException while using Scanner

后端 未结 5 1773
一整个雨季
一整个雨季 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:29

    This is how I would proceed:

    • look up what that Exception means in the API documentation.
    • think of how it could happen, what line it happens on (look at your stack trace). If you don't know how to read the stacktrace, here's a tutorial.
    • if you can't immediately see the reason, set a breakpoint and run it through your debugger to "visualize" the current state of your program before the exception happens.

    You might not know how to use your debugger yet, and while some might not agree, I think it's never too early. There are some excellent video tutorials on how to use the debugger here. Good luck!

提交回复
热议问题