public class Mortgage{ private float rate; private int years; public void setRate(float rate){ this.rate = rate; } public float getRate(){ return this.rate; } public void setYears(int years){ this.years = years; } public int getYears(){ return this.years; } public Mortgage(){} public Mortgage(float rate, int years){ this.rate = rate; this.years = years; } }