Swing中常用的复杂继承关系测试实例

2014-11-23 17:34:53 · 作者: · 浏览: 78

Swing中常用的复杂继承关系测试实例


1、


package com.szsm.swing.other;


public class ExtendsTest {


public static void main(String[] args) {
new ExtendsTest().new Son();
}

class Son extends Parent
{
// public Son() {
// System.out.println("son");
// }

public void init()
{
System.out.println("son init");
}
}
abstract class Parent
{
public Parent() {
System.out.println("father");
init();
}

public void init()
{
System.out.println("father-init");

}
}
}


2、


father
son init