本帖最后由 zc332750 于 2014-2-8 09:37 编辑
class Fu
{
String name ="我很好";
}
class Zi extends Fu
{
String name = "你好";
public void show(){
String name = "真的好吗";
System.out.println(name);
}
}
class ExtendsDemo1
{
public static void main(String[] args)
{
Zi z = new Zi();
z.show();
//System.out.println("Hello World!");
}
}
运行结果为什么是“真的好吗”
|
|