所以我想知道是否可以在 Java 中追溯一个数组列表?意思是,如果我有类似的东西:
Section aSection = new Section();
aMainSection.get(0).aChildSection.add(aSection);
其中'aMainSection'和'aChildSection'都是类型部分的数组列表,我可以从'aChildSection'追溯以获取存储在其父部分'aMainSection'中的值吗?或者我是否必须在部分类中创建某种方法来执行此操作?感谢您提供的任何帮助。