[Logo] JavaRanch » Big Moose Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Professional Certification » Programmer Certification (SCJP)  XML New topic
Author

String doubt

Ashok Pradhan
Ranch Hand

Joined: Dec 17, 2007
Messages: 144

in JLS It states that for any two strings s and t, s.intern() == t.intern() is true if and only if s.equals(t) is true.



OUTPUT
true
false

i am confusing why line 2 returns false.please explain it and thanks.
sridhar row
Ranch Hand

Joined: Jan 16, 2008
Messages: 161

What do you want it to return? hint: You are using ==.
Ashok Pradhan
Ranch Hand

Joined: Dec 17, 2007
Messages: 144

Thanks I get it.
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Professional Certification » Programmer Certification (SCJP)  XML New topic
java monitoring

Contact Us | Visit our Java home page!
Copyright © 1998-2009 Paul Wheaton
Powered by JForum 2.1.8 © JForum Team