得到一个我遇到的问题
public class Student{ private String studentNumber; private String studentName; private double studentResult; public Student (String aNumber,String aName){ setStudentNumber(aNumber); setStudentName(aName); setStudentResult(0); } // The standard getter and setter method are define here. }
在构造函数中使用setter方法的目的是什么?并且使用setStudentResult(0),我们需要另一个实例变量吗?