public class Loan {
private double annualInterestRate;
private int numberOfYears;
private double loanAmount;
private Date loanDate;
public Loan() {
this(2.5, 1, 1000);
}
public Loan(double annualInterestRate, int numberOfYears,
double loanAmount) {
this.annualInterestRate = annualInterestRate;
this.numberOfYears = numberOfYears;
this.loanAmount = loanAmount;
loanDate = new Date();
}
}
public Loan(){}方法有什么用。