`

java的thows和throw的区别

 
阅读更多
//static 表态的 final修饰符,子类不能重写
	//throws Exception声明在方法参数的后面,有可能会抛出异常,可以抛出多个异常;
	public static final void testThrow(String str) throws Exception
	{
		try
		{
			System.out.println("你好Throws Throw");
		} catch (Exception e)
		{
			//声明在方法体内,抛出异常
			throw e;
		}
	}

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics