java的重写overrid
package day;
public class day5 {
public static void main(String[]args)
{
ChildClass a=new ChildClass();
}
}
class FatherClass
{
public int value;
public FatherClass()
{
System.out.println("Fatherclasss.value");
}
}
class ChildClass extends FatherClass
{
public int value;
public ChildClass()
{
System.out.println("ChildClass");
}
}
这里,子类child继承父类时,构造方法自动调用super方法,