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

Possible errata in Practice Exam 2, OCA (Java OCA 8 Programmer I Study Guide, Sybex)

 
David Quinn
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Possible errata in Practice Exam 2, OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide: Exam 06Z0-808

There is a question about true statements regarding String and StringBuilder. One of them is:

For a StringBuilder, capacity would be a redundant property.

The exam scores that statement as false. I say that the statement is true, because you already have access to the capacity() method. You could use the capacity() method without ever needing the capacity property. Hence, adding a property for capacity adds no value, and is superfluous/redundant. This may be a matter of semantics, but I think that my answer deserves credit.

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David,
Welcome to CodeRanch!

That's not an errata. If there weren't a capacity property, there wouldn't be a capacity method either. That answer is right after whether capacity is redundant for String, which is it.

On the real exam, you know how many choices are correct. But try not to read into the questions. Since the String/StringBuffer answers are paired, it's fairly obvious the choices are about the difference between the two rather than subtle implications of the English language.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, at least in Open JDK, there isn't a field named capacity. This is a logical concept in both the code and the question.
 
David Quinn
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response, Jeanne.

Your book emphasizes how the exam creators are always out to trick us, so it seems contradictory to suggest that I assume the obvious intentions of the question.

I'll accept your explanation, though.

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Quinn wrote:Thanks for your response, Jeanne.

Your book emphasizes how the exam creators are always out to trick us, so it seems contradictory to suggest that I assume the obvious intentions of the question.

I'll accept your explanation, though.


Oh, they totally want to trick you. But not through edge cases of the English language .
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David Quinn,

First of all, a warm welcome to CodeRanch!

David Quinn wrote:For a StringBuilder, capacity would be a redundant property.

The exam scores that statement as false. I say that the statement is true, because you already have access to the capacity() method.

For what it's worth, I agree with Jeanne on this one. From the context of the question (and the different statements), it should be really obvious that this question is testing you about the differences between the String and StringBuilder classes. The actual exam tells you how many answers are correct. If answers are borderline correct, choosing the best answer becomes an important skill. And then the "context of a question" could be (very) important. In this thread you'll find a nice discussion about this "context of a question", it's definitely worth reading.

Hope it helps!
Kind regards,
Roel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic