File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes String Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "String Object " Watch "String Object " New topic

String Object

Mr Iftikhar
Ranch Hand

Joined: Oct 12, 2001
Posts: 39
Select the correct answer.
Which one method can change the String object.
1) toUpperCase()
2) concat()
3) charAt()
4) substring()
5) non of the above

Is there any method which can change the String object.
(But String is Immutable.)

java language
Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610
you got it, no method can change the String object, thus the answer is 5.
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform

[Blog] [Blogroll] [My Reviews] My Linked In
Mr Iftikhar
Ranch Hand

Joined: Oct 12, 2001
Posts: 39
Thanks Valentin Crettaz.
I agree. Here's the link:
subject: String Object
Similar Threads
String & StringBuffer -- Difference
pass or copy by reference
reading integer from a file
objects r passed by references
How to find and replace a substring from a given string