结果怎么有点奇怪
class Test1
{
public String str = "test1";
public String getStr()
{
return str;
}
}
public class Test2 extends Test1
{
public String str = "test2";
public String getStr()
{
return str;
}
public static void main(String args[])
{
Test1 t1 = new Test2();
System.out.println(t1.str);
System.out.println(t1.getStr());
}
}