Thread: Quiz Time
View Single Post
  #34 (permalink)  
Old 05-08-2008, 12:25 PM
Eranga's Avatar
Eranga Eranga is offline
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,338
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Quote:
Originally Posted by sanjeevtarar View Post




Ans will be YES ...... because trim() method will be called first
No, you are wrong. Because trim() not will effect with '==' operators. That one of the deprecate process take place by Suns'

If you do it as follows,

Code:
if("String".equals("String ".trim())) System.out.println("Yes"); else System.out.println("No");
Your answer is "Yes". trim() do the omitting white spaces perfectly.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote