iteratedarithmeticexception.java
来自「Beginning Java 2, SDK 1.4 Edition Exerci」· Java 代码 · 共 27 行
JAVA
27 行
//Chapter 7 Exercise 4
// IteratedArithmeticException class
public class IteratedArithmeticException extends Throwable {
private int iteration = 0; // Iteration number at which exception occurred.
// Default Constructor:
public IteratedArithmeticException(){}
// Standard constructor:
public IteratedArithmeticException(String s) {
super(s); // Call the base constructor.
}
public IteratedArithmeticException(int iteration) {
super(); // Call the base constructor.
this.iteration = iteration; // Set the iteration number.
}
// Get the array index value for the error:
public int getIteration() {
return iteration; // Return the iteration number.
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?