aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes String doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "String doubt" Watch "String doubt" New topic
Author

String doubt

Ashok Pradhan
Ranch Hand

Joined: Dec 17, 2007
Posts: 179

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
Posts: 162
What do you want it to return? hint: You are using ==.
Ashok Pradhan
Ranch Hand

Joined: Dec 17, 2007
Posts: 179

Thanks I get it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String doubt
 
Similar Threads
StringBuffer and String doubt
Deadlocks in Threads?
Object Create
String.intern() Method
this will make you think