java类引用其他类问题

比如说有3个类,Person,Students,Scores类。

其中Person类中引用了Students类,privatestudent,

然后Student类引用了Scores类,private List score; 那么在Person类中怎么得到Scores里面的属性?

在Person类方法内部使用如下语句获取:

List<Scores> scoreList = student.getScore();

通过student属性, 再找到student属性中的List score集合,遍历集合就能获取到score.

Person.student.score