I am new to java, and I need help understanding what the code is trying to do. I am interested on the last line( sd.setId(sh.getGrade().getSchoolId());). I know it is setting using setId in sd object, but then I am bit confused what the rest of the line(sh.getGrade().getSchoolId()) is trying to do. Does getSchoolId() method called first and then sh.getGrade() and set everything in sd? How do I read a code when there are multiple dot(.) operators in a single line of code?
while (oneIter.hasNext()) {
ShoolHistory sh= (ShoolHistory) oneIter.next();
ScoolDetailId sd = new ScoolDetailId();
sd.setId(sh.getGrade().getSchoolId());