请问个scjp的问题~

[复制链接]
查看11 | 回复2 | 2006-9-6 21:14:23 | 显示全部楼层 |阅读模式
Which of the following statements are true?
1) Methods cannot be overriden to be more private
2) static methods cannot be overloaded
3) private methods cannot be overloaded
4) An overloaded method cannot throw exceptions not checked in the base class

Methods cannot be overriden to be more private这句是什么意思~?
回复

使用道具 举报

千问 | 2006-9-6 21:14:23 | 显示全部楼层

class Parent {
protected void test(){}
}
class Child {
public void test(){}
}
复制代码可以

class Parent {
protected void test(){}
}
class Child {
private void test(){}
}
复制代码不可以
回复

使用道具 举报

千问 | 2006-9-6 21:14:23 | 显示全部楼层
oh,thanks
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行