本帖最后由 全海波 于 2012-8-4 09:43 编辑
- class FuZi
- {
- public static void main(String[] args)
- {
- Zi z = new Zi();
- z.function();
- //z.show();
- //Fu f = new Zi();
- //f.show();
- //f.function();
- }
- }
- class Fu
- {
- void show()
- {
- System.out.println("fu show");
- }
- }
- class Zi extends Fu
- {
- void function()
- {
- super.show();
- this.show();
- }
- void show()
- {
- System.out.println("zi show");
- }
- }
- 为何super与this可同存呢?
复制代码 |
|