• 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
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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: 11338
177
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
Marshal
Posts: 38681
677
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!