This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes language and utilities expert level question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "language and utilities expert level question" Watch "language and utilities expert level question" New topic
Author

language and utilities expert level question

Dan Xu
Greenhorn

Joined: Nov 29, 2002
Posts: 15
what will be the output when the following code is compiled and run(assuming written inside main)?

String s1 = new String("amit");
String s3="arit";
String s2=s1.replace('m','r');
System.out.println(s2==s3);

why does it print out False?i think s2==s3 is ture.cos both of them are "arit".
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
Link


SCJP Tipline, etc.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: language and utilities expert level question
 
Similar Threads
about string
question on Strings
Doubt in Strings
one more on ==
doubt about Strings from Whizlabs