📅  最后修改于: 2022-03-11 14:58:07.933000             🧑  作者: Mango
class Test {
public static void main(String[] args) {
A[] arr = { new B(), new C(), new C() };
for (int i = 1; i < arr.length; ++i) {
arr[i].set(arr[i-1].get());
}
System.out.println(arr[arr.length - 1].get());
}
}