Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Errata for Chapter 4 question 14  RSS feed

 
Diego Moncayo
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The stream is being used twice (line 5 and 6) so the execution of the code throws an exception. The answer would be F instead of D
 
Roel De Nijs
Sheriff
Posts: 11338
177
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Always useful to mention the study guide in the subject (and/or post)
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37222
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Diego,
Welcome to CodeRanch! That question looks like it is from my book (Sybex.)

D is that the code doesn't compile.  Which it doesn't. So the fact that it would throw an exception if it did compile never comes up. Code has to compile for runtime errors to be a problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!