• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

substring method signatures errata item? (Java OCA 8 Programmer I Study Guide)

 
Greenhorn
Posts: 18
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On page 107 of "OCA Java SE 8 Programmer 1", the substring() method signatures are listed as follow:
int substring(int beginIndex)
int substring(int beginIndex, int endIndex)

But substring() returns part of a String. Hence, correct signatures are as follow:
String substring(int beginIndex)
String substring(int beginIndex, int endIndex)
 
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 Cedric Georges,

First of all, a warm welcome to CodeRanch!

But substring() returns part of a String. Hence, correct signatures are as follow:
String substring(int beginIndex)
String substring(int beginIndex, int endIndex)


True! As far as I can see, it's not yet listed in the confirmed errata list, so you discovered another errata item. Jeanne & Scott will be very thankful!

Hope it helps!
Kind regards,
Roel
 
Ranch Hand
Posts: 789
Python C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote:Hi Cedric Georges,

First of all, a warm welcome to CodeRanch!

But substring() returns part of a String. Hence, correct signatures are as follow:
String substring(int beginIndex)
String substring(int beginIndex, int endIndex)


True! As far as I can see, it's not yet listed in the confirmed errata list, so you discovered another errata item. Jeanne & Scott will be very thankful!

Hope it helps!
Kind regards,
Roel



In the good old days if you wrote in with an erratum the publisher would mail you a free copy of the next edition.
 
Roel De Nijs
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

Guillermo Ishi wrote:In the good old days if you wrote in with an erratum the publisher would mail you a free copy of the next edition.


Between the release dates of K&B6 and K&B7 you have a gap of 6 years. Luckily patience is a great virtue!
 
author & internet detective
Posts: 40487
823
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

Roel De Nijs wrote:True! As far as I can see, it's not yet listed in the confirmed errata list, so you discovered another errata item. Jeanne & Scott will be very thankful!


It is now! Thanks!

Guillermo Ishi wrote:In the good old days if you wrote in with an erratum the publisher would mail you a free copy of the next edition.


Heh. it's hard to get publishers to even post errata these days. I actually like having it on our blog (and here.) Makes for better discussion/searchability/faster response.
 
Liar, liar, pants on fire! refreshing plug:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic