super("111");//手动调用

阅读 21

2023-06-16


class Base 
{
	public Base()
	{
		System.out.println("Base()!");
	}

	public Base(String str)
	{
		System.out.println("Base!"+str);
	}

	public static void main(String[] args) 
	{
		System.out.println("Hello World!");
	}
}

public class Derive extends Base 
{
	public Derive()
	{
		//super(); //默认调用这一个
		super("111");//手动调用这一个
		System.out.println("Derive()!");
		
		
	}

	public static void main(String[] args) 
	{
		System.out.println("Hello World!");
		Derive onj=new Derive();

	}
}
/*
Hello World!
Base!111
Derive()!
请按任意键继续. . .
*/



精彩评论(0)

0 0 举报