An Improvement
[ Home ] [ Up ] [ Example 1 ] [ Running Example 1 ] [ An Improvement ] [ Example 2 ] [ Running Example 2 ]

 

 

But we can do better than that!

There are some deficiencies with this particular implementation:

  • Stack::Enumerator still knows more about the internals of Stack than it should
  • Users need to know about the nested class in order to use it;  this is really unnecessary detail for them to have to know.

So, let's improve the situation...

 

This page was last modified on 02 October, 2007