illegalrectangleexception.java

来自「此程序可实现:在可视化界面中随即生成一些图形(长方形、椭圆、圆、正方形);程序会」· Java 代码 · 共 20 行

JAVA
20
字号
public class IllegalRectangleException extends Exception {

	/**
	 * A class extends Exception.
	 * @author Ruixiao Wu.
	 * @version 1.0 26/06/2006.
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * A method to check whether it is a square and throws the Exception.
	 */
	public void check(int length, int weigth) throws Exception {
		try {
			if (length == weigth)
				throw new IllegalRectangleException();
		} catch (IllegalRectangleException e) {			
		}
	}
}

⌨️ 快捷键说明

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