- class Fu
- {
- void method1()
- {
- System.out.println("fu---1");
- }
- void method2()
- {
- System.out.println("fu---2");
- }
- }
- class Zi extends Fu
- {
- void method1()
- {
- System.out.println("zi---1");
- }
- void method3()
- {
- System.out.println("zi---3");
- }
- }
- class Demo14
- {
- public static void main(String[] args)
- {
- Fu f = new Zi();
- Zi z = (Zi)f;
- z.method1();
- z.method2();
- z.method3();
- }
- }
复制代码 在内存中是怎样执行的顺序...求解...... |
|