This week's book giveaway is in the NodeJS forum.
We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line!
See this thread for details.
Win a copy of Serverless Applications with Node.js this week in the 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Dash is missing on page 115 (Java OCA 8 Programmer I Study Guide)  RSS feed

 
Ranch Hand
Posts: 207
27
Java jQuery Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On page 115, the example of insert method

The line 6 // sb = -ani-mals should be // sb = -ani-mals-
 
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

Mushfiq Mammadov wrote:The line 6 // sb = -ani-mals should be // sb = -ani-mals-


That's true!

And would the output be the same if you swapped lines 4 and 6?
 
Mushfiq Mammadov
Ranch Hand
Posts: 207
27
Java jQuery Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Roel De Nijs wrote: And would the output be the same if you swapped lines 4 and 6?


If we add and remove characters, their indexes change. So the output would not be the same. If we swapped lines 4 and 6 the output will be:
  • line 4 --> anim-als
  • line 5 --> -anim-als
  • line 6 --> -anim-a-ls
  •  
    Roel De Nijs
    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

    Mushfiq Mammadov wrote:If we add and remove characters, their indexes change. So the output would not be the same.


    True indeed!

    Mushfiq Mammadov wrote:If we swapped lines 4 and 6 the output will be:

  • line 4 --> anim-als
  • line 5 --> -anim-als
  • line 6 --> -anim-a-ls

  • Spot-on!
     
    author & internet detective
    Posts: 39208
    726
    Eclipse IDE Java VI Editor
     
    I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
    global solutions you can do in your home or backyard
    https://coderanch.com/t/708587/global-solutions-home-backyard
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!