Hi,
After thinking about this some more (which is hard to avoid once you've invested the effort of making a descriptive post about your problem), I'm guessing the answer is going to lie in the syntax of
- I imagine that's what the answer calls
pre-incrementing logic - I see that the third 'part' I'd expect to be present in a
for statement is missing.
This raises another, more general and hence more important question about the exam - was I supposed to know about this syntax? To clarify what I mean:
* I'm pretty sure this was not explicitly explained in the scope of Chapter 1 and
* Gazing over the topics of future chapters, it seems this might be covered in Chapter 6 - not something I was assumed to have read by now.
Is this question an example of an "accidental" reliance on knowledge that was not (yet) treated in the book? My real question here is: will the exam assume technical knowledge not explicitly covered in this book or present in the Objectives, and if so, how do I best prepare for this?
To further illustrate what I mean (just so you don't think I'm being pedantic about the order of topics in the book): in the same self test series I also answered questions 2 and 5 incorrectly, simply because I'd never seen or used
System.out.print(String) before (as opposed to
println), including in the first chapter of the study guide. In hindsight, it seems pretty obvious that the writers just assumed everyone would have at least seen
print(String) before.
However, when answering the question I simply assumed it was a sneaky way of introducing a compilation error. Is there a list out there of "Java common assumed knowledge" - or should I just have gone through Java's documentation for
System.out beforehand?
Apologies for the mini-rant! If the correct answer does not depend on the used
for syntax, it would be nice if we could pretend this reply doesn't exist - thanks!