• 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

Kathy's Book pg 366

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i was just wondering if the method abt reversing string using string buffer's reverse method on pg 366 of her book , the example given there
"StringBuffer sb = new StringBuffer("A man a plan a canal Panama");
System.out.println(sb);//output is"amanaP lanac a nalp a nam A"
is it how it behaves or was it an error
???
 
Ranch Hand
Posts: 366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Prem,
I tried and its working normally. What i can suggest is to delete your .class file and recompile your program
Regards
Sri
 
Prem Mander
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi sri
thanks for u r instant reply, but was just wondering if you happen to read the pg 366 of kathy's book
Prem
may be you would than understand what i meant
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Prem -
Good catch ! Obviously the second line of code should be:
sb.reverse();
We'll add this one to the errata ! :roll:
-Bert
(falling on his sword ...)
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic