问题标签 [arithmeticexception]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
38 浏览

java - ArithmeticException 未被捕获

我在我的一个类中定义了以下方法:

稍后在我的程序中,我使用用户输入来设置 priceSoldFor 和 costToCompany 的值。尽管我将 costToCompany 设置为 0,但从未发生异常。我该如何解决?