• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic