62,623
社区成员
发帖
与我相关
我的任务
分享
interface Machine
{
void run();
}
class Person
{
void run()
{
System.out.println("run");
}
}
class Robot extends Person
{
private class MachineHeart implements Machine
{
public void run()
{
System.out.println("MachineHeart run");
}
}
Machine getMachine()
{
return new MachineHeart();
}
}
class Test
{
public static void main(String[] args)
{
Robot robot = new Robot();
Machine m = robot.getMachine();
m.run();
robot.run();
}
}
public void dealList(List list)