public class parent
{
public void test()
{}
public parent()
{
test();
}
public static void main(string[] args)
{
new child();
}
}
class child extends parent
{
private int instancevalue = 20;
public void test()
{
system.out.println("instance value is: " + instancevalue);
}
}
public student extends person
{
string school = ”it315”;// 显式初始化
……
}
public student extends person
{
public student(string name,int age,string school)
{
super(name,age);
this.school = school;
}
}
新闻热点
疑难解答
图片精选