class Super {
public Integer getLenght()
{ return new Integer(3); }
}
public class Test extends Super
{
public Long Get() { return new Long(5); }
public static void main(String[] args) {
Super sooper = new Super();
Test sub = new Test();
System.out.println(
sooper.getLenght().toString() + ";" +
sub.getLenght().toString() );
}
}
public Integer getLenght()
{ return new Integer(3); }
}
public class Test extends Super
{
public Long Get() { return new Long(5); }
public static void main(String[] args) {
Super sooper = new Super();
Test sub = new Test();
System.out.println(
sooper.getLenght().toString() + ";" +
sub.getLenght().toString() );
}
}
public Integer getLenght()
{ return new Integer(3); }
}
public class Test extends Super
{
public Long Get() { return new Long(5); }//此处函数名为Get !!!!!
public static void main(String[] args) {
Super sooper = new Super();
Test sub = new Test();
System.out.println(
sooper.getLenght().toString() + ";" +
sub.getLenght().toString() ); //此处调用的是getLength !!!!!!
}
}只有父类里面有getLength函数啊,子类没有,怎么调用子类的呢??????
只有一个,而且在父类里面。