利用异常,确保输入非负怎么办?[解决办法]if (0 > input) { throw new Exception( "The number is less than 0 "); } 但是这是非常不好的设计方法, 处理异常的开销是很大的, 因此, 应该尽可能少的使用异常