⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iteratedarithmeticexception.java

📁 JAVA 2入门经典 练习答案
💻 JAVA
字号:
// Chapter 7 Exercise 3

// 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.
    
  }

  public int getIteration()	{ // Get the array index value for the error.
    return iteration;		// Return the iteration number.
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -