| Author |
A Collection of javabeans Iterator
|
Higgledy Smith
Ranch Hand
Joined: Mar 07, 2006
Posts: 192
|
|
I in my code I create a collection of Department javabeans. Department class contains an overridden toString() method. In the Iterator code below, how do I guarantee the toString() used is the overridden Department toString and not the Java provided Object toString?
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
|
It is impossible for it to be anything else. If a class overrides a method, then no other class can call the original version on objects of that class; they can only call the new, overriding version.
|
[Jess in Action][AskingGoodQuestions]
|
 |
 |
|
|
subject: A Collection of javabeans Iterator
|
|
|