previous | start | next

## Overriding `toString` in Subclass

- Format superclass first

-     public class Manager extends Employee

      {

         public String toString()

         {

            return super.toString()

               + "[department=" + department + "]";

         }

         ...

      }

- Typical string

      Manager[name=Dolly Dollar,salary=100000][department=Finance]

- Note that superclass reports actual class name

previous | start | next