This week's book giveaway is in the Go forum.
We're giving away four copies of Head First Go and have Jay McGavren on-line!
See this thread for details.
Win a copy of Head First Go this week in the Go forum!
  • 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
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Mock 3 exam typo in explanation (Java OCA 8 Programmer I Study Guide)  RSS feed

 
Greenhorn
Posts: 9
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the question about the String methods

The explanation starts with the sentence "Line 6 returns the number 3 since indexes are zero based." The index of number 6 in the string is 2 and not 3.
 
Sheriff
Posts: 11604
178
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Vince Botteman wrote:The explanation starts with the sentence "Line 6 returns the number 3 since indexes are zero based." The index of number 6 in the string is 2 and not 3.


You are correct! Should definitely be Line 6 returns the number 2 since indexes are zero based. The remainder of the explanation is spot-on: total has a value of 6 (2 + 4) and charAt(4) will throw a StringIndexOutOfBoundsException.
 
author & internet detective
Posts: 39175
724
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agreed. I'm collecting a bunch of minor exam issues and reporting to the publisher in one go. (The one about the botched question I reported as soon as I knew about it.) In the meantime, it is listed in the errata with you as the finder. Thanks for pointing it out!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!