package 继承构造函数;
public class sss {
public static void main(String[] args) {
// TODO Auto-generated method stub
zi z=new zi();
System.out.println(z.getname());
}
}
class fu
{
String name="fu";
public String getname()
{
this.run();
return this.name;
}
public void run()
{
System.out.println(name+" run...");
}
}
class zi extends fu{
String name="zi";
public void run()
{
System.out.println(name+"zi run....");
}
}
public class sss {
public static void main(String[] args) {
// TODO Auto-generated method stub
zi z=new zi();
System.out.println(z.getname());
}
}
class fu
{
String name="fu";
public String getname()
{
this.run();
return this.name;
}
public void run()
{
System.out.println(name+" run...");
}
}
class zi extends fu{
String name="zi";
public void run()
{
System.out.println(name+"zi run....");
}
}