- package com.dongchao;
- class Fu
- {
- void show(){
- System.out.println("Fu show run..");
- }
- }
- class Zi extends Fu
- {
- void show()
- {
- System.out.println("Zi show run...");
- }
- }
- class ExtendsDemo {
- public static void main(String[] args)
- {
- Zi z = new Zi();
- z.show();
- }
- }
- //该片段来自于http://www.codesnippet.cn/detail/2312201615211.html
来源: http://www.codesnippet.cn/detail/2312201615211.html