调整有时是迅雷不及掩耳盗铃,MM实在没理由就来个FAT FINGER# Stock
l*e
1 楼
/* There exists the following interface
public interface Container {
Container getParent(); //if there is no parent, getParent() returns null
String getName();
}
Create a method printContainers(Container c) that prints out the names of
all the parent containers in the order of the top-most parent container
first.
For example, assume the following:
a.getParent() returns b
a.getName() returns "foo"
b.getParent() returns null
b.getName() returns "bar"
printContainers(a) should print to the console:
"bar"
"foo"
*/
public interface Container {
Container getParent(); //if there is no parent, getParent() returns null
String getName();
}
Create a method printContainers(Container c) that prints out the names of
all the parent containers in the order of the top-most parent container
first.
For example, assume the following:
a.getParent() returns b
a.getName() returns "foo"
b.getParent() returns null
b.getName() returns "bar"
printContainers(a) should print to the console:
"bar"
"foo"
*/