在线程“主要”数字格式异常例外:输入字符串:”;
Exception in thread "main" java. lang. NumberFormatException: For input string: ";
如果指定了多个输出格式,那么将生成一个错误(异常)并且不会运行报告。
If multiple output formats are specified, an error (exception) will be generated and the report will not be run.
如果字符串不能为空或者必须为特定格式,请检查格式并抛出异常。
If the string can't be empty or must be in a specific format, check for the format and throw an exception.
I'm much better having an exception get handled at the time of input than to let that prop -- that value rather propagate through a whole bunch of code until eventually it hits an error 17 calls later, and you have no clue where it came from.
不是我期望的格式,这时我最好有一个异常处理,而不是让其传下去,这个值传到代码的整个分支,最终会导致一个错误17调用的发生,并且你不知道这个错误是哪里来的。
Right, so an exception then has this format that I can control as a programmer.
好的,所以一个异常会有这样的格式,我能把他当做一个程序员来控制。
应用推荐