Which of the following prints OhNo with the assertion failure when the number is negative?
Which of the following prints OhNo with the assertion failure when the number is positive?
Question 11 is wrong in the online version of the test from https://sybextestbanks.wiley.com. It shows IllegalFormatException as option A, but gives the same answer as correct (implying IllegalFormatException isn't a RuntimeException). The book is correct though, as the value for option A is Exception. I take it this has already been spotted and corrected, but I thought I'd add a note here for those who are only taking the tests online.
Page 32, question 17: technically, a class which implements Serializable may be in a try-with-resource statement (as long as it also implements Autocloseable or Closeable).
#9 - This is in error and I've logged it. This is a good catch because none of the answers are correct as currently worded.
#11 - We did not know about this. In theory, the online materials are the same as the book (plus the online materials could have corrections.) In practice, some rendering errors slip through. It's also more difficult than you'd expect to get the online stuff corrected (we can't do it directly.) So I batch them and then bring them up with Wiley. It'll take me about a month to do that as I'm really busy in February mentoring a robotics team.
# 17 on page 322 (your turn to make a typo - calling it page 32), that's true. It's not an errata in that we planned to write that. It's also not wrong per se in that you can't assume other things that aren't in the question. It could be worded more precisely though which I've noted (in my private list) for if we write a Java 9 version of this book.