File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

you cannot call append() on String objects

 
kay lin
Ranch Hand
Posts: 132
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:
I was just doing some of the practice exam for SCJP 1.4
i came across a string related question



and it asks you what the result is..

I think the compilation would fail, wouldnt it. Since d is a String object, and i don't think you can call append() on String..you could do that with a StringBuffer....

please let me know.

Many thanks..
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a compilation error
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're preparing for the exam, my advice is to write lots of code to test and verify your understanding. That way, you get the practice, immediate feedback, and reinforcement.

(Besides, you could probably test this in less time than it took to post. )
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A 30 second check of the String API would hurt you.
 
Aniket Patil
Ranch Hand
Posts: 218
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A 30 second check of the String API ~wouldn't~ hurt you.


True...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic