Which of the following methods can be legally inserted in place of the comment //Method Here ?

sdmaxdjd 2002-01-06 04:15:50
class Base{
public void amethod(int i) { }
}

public class Scope extends Base{
public static void main(String argv[]){
}
//Method Here
}
1) void amethod(int i) throws Exception {}
2) void amethod(long i)throws Exception {}
3) void amethod(long i){}
4) public void amethod(int i) throws Exception {}
...全文
88 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
cqing 2002-01-07
  • 打赏
  • 举报
回复
2 3
sdmaxdjd 2002-01-07
  • 打赏
  • 举报
回复
reason
0legend 2002-01-07
  • 打赏
  • 举报
回复
重写父类的方法,父类没有抛出的例外,他也没有(我认为,有待大家考证)。
0legend 2002-01-06
  • 打赏
  • 举报
回复
3

23,407

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧