I\'m a newbie to Java. Now I\'m studying equals and == and redefinition of equals and toString.
I would like to use both the toString method that I have redefied and
You can call super() method to execute the corresponding superclass method.
class Employee{
...
public String toString(){
String s = super.toString();
return getClass().getName() + "[name = " + name +
", salary=" + salary + ", hireDay=" + hireDay + "]" + s;
}
toString() in Object class is as follows
public String toString() {
return getClass().getName() + "@" + Integer.toHexString(hashCode());
}