willhogan11 / Golf_n_HomeSwap

4th Year Project for module "Applied project & Minor Dissertation"
0 stars 0 forks source link

Overloading implementation #42

Closed AndrejLavrionovic closed 7 years ago

AndrejLavrionovic commented 7 years ago

Hi Will, It is up to you. You can close this issue as it is not really an issue, but it just suggestion. In User.java you created get/setPermanentPassword

public void setPermanentPassword(String password) {
    this.password = password;
}

public String getPermanentPassword() {
    return password;
}

One of the strongest feature in java is method overloading and it can be nicely used in this context. You can remove

public String getPermanentPassword() {
    return password;
}

as this statement doing nothing and put following statement using method overloading

public void setPassword(String password){
      this.password = password;
}

instead of

public void setPermanentPassword(String password) {
    this.password = password;
}

It will nicely work. I commented this part in the file.

Again it is up to you