• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Errors in OCP 1Z0-815 Wiley Test Banks Bonus Exam 1: question 76

 
Ranch Hand
Posts: 185
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Question 76, answer D "Traditional for loops contain an increment clause" is one of the correct answers. However, this answer should be incorrect since the statement is false. The traditional for loop has an update statement, but it can be empty, and it can be other types of updates, such as a decrement clause. So to say that it contains an increment clause is not correct.
 
Marshal
Posts: 67437
257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please start a new thre‍ad for a new question: I'll do it for you this time.

Please provide full details of the question. I would say that the traditional for statement is...so I think that answer is correct. What you are arguing is that the question is wrong because a for loop sometimes has something other than an increment. The Java® Language Specification doesn't apply names to the different parts of a for statement header. The Java™ Tutorials, however, use the term “increment”.
 
Edmund Yong
Ranch Hand
Posts: 185
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer is quite ambiguous, so I was quite hesitant on this answer. Let's say that we agree that "increment clause" is the formal name for it, it still can be absent in the for loop:

for ( ; ; ) {
...
}

The ambiguity would have been removed if "can contain increment clause" is used instead.
 
author & internet detective
Posts: 39789
797
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edmund,
Yes this is the correct forum for both errata or asking questions about the book exam.

Since Campbell, mentions the Java Language Specification, it says:


In the book we called "for update" an increment clause to make it easier to remember. The question is differentiating between a traditional for and a while loop.  I put it on our private list of things to consider clarifying for the next book. I don't consider it an errata though.

Note: On the real exam, you are always told how many questions are correct. So less questions depend on parsing English/intent. Also, on the real exam, the most logical understanding of a sentence is correct. You don't want to get a question wrong because you read into it!
 
Campbell Ritchie
Marshal
Posts: 67437
257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... but I don't think they intended that bit of code to be called, “forUpdate”. “Update part of the for statement header,” maybe.
 
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!