For example I have a method which displays the information about the instance of Employee
//Displaying the instance of the object information in a anesthetically pleasing manner
public void display() {
System.out.println("Employee Information");
seperationLine();
System.out.println("Name: " + getName());
seperationLine();
System.out.println("PPS number: " + getPpsNum());
seperationLine();
System.out.println("Salary: " + getSalary());
}
Should I use the this
keyword in the method and other methods which need to use a attribute or is it not necessary
//Displaying the instance of the object information in a anesthetically pleasing manner
public void display() {
System.out.println("Employee Information");
seperationLine();
System.out.println("Name: " + this.getName());
seperationLine();
System.out.println("PPS number: " + this.getPpsNum());
seperationLine();
System.out.println("Salary: " + this.getSalary());
}