bethrobson / Head-First-Design-Patterns

Code for Head First Design Patterns book (2020)
3.15k stars 1.92k forks source link

Question of ArrayList type in Iterator Pattern #3

Closed wuyh115 closed 8 years ago

wuyh115 commented 8 years ago

package headfirst.designpatterns.iterator.transition; import java.util.*; public class Waitress { ArrayList menus;

The code in page 360 defined the ArrayList as type Menu. However, in git repo, the type is MenuItem. As I understand, the type should be Menu. Could you please help confirm whether I am correct?

Thank you for your help in advance.

bethrobson commented 8 years ago

Hi, You are right! I've fixed the code in the /transition package and also added some code for testing purposes.

Thank you!

Elisabeth