
05-08-2008, 12:25 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,338
|
|
Originally Posted by sanjeevtarar
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,
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.
|