• 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

OCA study guide by Jeanne & Scott : substring() method returns int

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Page : 107
substring() method returns int instead of String.
Please see the attached pic for reference.
Can anyone please confirm.
WhatsApp-Image-2019-07-20-at-5.52.36-PM.jpeg
[Thumbnail for WhatsApp-Image-2019-07-20-at-5.52.36-PM.jpeg]
 
Rancher
Posts: 261
12
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the version of the book that I have, also on p107, it says the return type is String (which is what you'd expect).

Maybe it is an error in your version that has been rectified afterwards.
 
Marshal
Posts: 79475
379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where does it say that substring() returns int? I can't see that; it says that indexOf() returns int, with −1 for “not found”.
 
Neha Agnihotri
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please look at the 7th line from bottom in the picture. I have marked it with a question mark.
 
Campbell Ritchie
Marshal
Posts: 79475
379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So it does. I didn't see that
Remember the following link: OCA I book link, where you will find that error has already been reported. Maybe BG has a newer edition with the error correct; I don't know.
 
Ranch Hand
Posts: 95
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Neha Agnihotri wrote:Page : 107
substring() method returns int instead of String.
Please see the attached pic for reference.
Can anyone please confirm.

Neha I understood your problem, some time we need to use our commen sence, it is good your are sharing your thoughts
Think about khaleed mughal book for ocajp-8
 
Neha Agnihotri
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sohail hussain wrote:Neha I understood your problem, some time we need to use our commen sence, it is good your are sharing your thoughts
Think about khaleed mughal book for ocajp-8



Thanks for your reply Sohail. I think you meant "common sense" ;)
On a lighter note, I am sure you must be knowing, common sense is not so common in common people.
reply
    Bookmark Topic Watch Topic
  • New Topic