0
点赞
收藏
分享

微信扫一扫

异常_重载和重写异常的区别

晚熟的猫 2022-03-25 阅读 84

【1】重载

package com.pyk.xl;

public class Demo {
	//重载
	public void a() throws Exception{
		
	}
	public void a(int age) throws ArithmeticException{
		
	}
}

【2】重写

父类:

子类:

 子类<=父类

举报

相关推荐

0 条评论