Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HF suggestion

 
Ion Gherasim
Greenhorn
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic