aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes String 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 "String Question" Watch "String Question" New topic
Author

String Question

robl
Greenhorn

Joined: Aug 26, 2000
Posts: 25
if("String".toString() == "String")
System.out.println("Equal");
else
System.out.println("Not Equal");
This prints Equal

if(" String ".trim() == "String")
System.out.println("Equal");
else
System.out.println("Not Equal");

This prints Not Equal - can somebody explain - thanks
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi ...
Check out the following
discussion thread


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
robl
Greenhorn

Joined: Aug 26, 2000
Posts: 25
Thanks - I get it now
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String Question