/*
多继承的安全隐患
*/
class A
{
String name = "哈哈";
public void method(){}
}
class B
{
String name = "嘻嘻";
public void method(){}
}
class C extends B
{
}
class ExtendsDemo1
{
public static void main(String[] args)
{
new C().name = "嘿嘿";
new C().method();
System.out.println("Hello World!");
}
}
|
|