源代码
public class inherit {
public static void main(String[] args){
first a=new first();
a.show();
}
}
class second{
String name;
{
name="zxr";
}
}
class first extends second{
int age=20;
void show()
{
System.out.println("名字"+name);
System.out.println("年龄"+age);
}
}