File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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