package day7;
class A1
{
String name = "zhangsan";
public A1()
{
System.out.println("A1");
}
public A1(String name)
{
this();
System.out.println("A2");
}
}
class B1 extends A1
{
String name = "wangwu";
public B1()
{
this("zhang");
System.out.println("B1");
}
public B1(String name)
{
super(name);
System.out.println("B2");
}
}
public class test04 {
public static void main(String args[])
{
new B1();//A1 A2 B2 B1
}
}
day7 test04
最新推荐文章于 2023-02-03 15:30:00 发布