• Post Reply Bookmark Topic Watch Topic
  • New Topic

HF suggestion

Ion Gherasim
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On pages 82, 84 and 87 there is presented that nice beer example but it could be somehow confusing from the part of view: after call the getBrands(c) it is obtained one List and based on iterator the type of beers are on screen. In this particular case the code is working fine. I assume it will not work in case the class BeerExpert have more complex data type. Now it have only the brand name but if it is added the price . As long as it is only the brand name, a String, an implicit cast to String is done into the println but if the price is introduced than iterator returns an object. In order to be more clear I think for the new revision of the book it can be introduce an explicit cast to String
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!