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

📄 exceptiondemo.java

📁 一个J2SE的简单入门
💻 JAVA
字号:
class ExceptionDemo
{
	public int Result(int i) throws Exception
	{
		if(i<0)
			throw new Less0Exception("result is:"+i);
		if(i>100)
			throw new More100Exception("result is:"+i);
			int j=i;
			return j;
	}
	class Less0Exception extends Exception
	{
		public Less0Exception(String msg)
		{
				super(msg);
		}
	}
	class More100Exception extends Exception
	{
		public More100Exception(String msg)
		{
				super(msg);
		}
	}
}

class Test
{
	public static void main(String args[]) throws Exception
	{
		ExceptionDemo t=new ExceptionDemo();
		t.Result(150);
	}
}

⌨️ 快捷键说明

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