• Post Reply Bookmark Topic Watch Topic
  • New Topic

HF suggestion  RSS feed

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
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!