Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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: 74064
332
  • 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: 74064
332
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic