The output is:
C: 3
B: 1
This is an example of polymorphism and run time binding of method calls. You have overloaded the toString() methodin C. Each object will call its own method when the time comes.