Click here to Skip to main content

Java

   

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page  Show 
  Refresh
QuestionA stupid question? [modified] Pinmembersharkbc2:09 17 Feb '12  
AnswerRe: A stupid question? PinPopularmemberBobJanova3:02 17 Feb '12  
AnswerRe: A stupid question? PinmemberTorstenH.3:11 17 Feb '12  
AnswerRe: A stupid question? Pinmemberjschell7:23 17 Feb '12  
GeneralRe: A stupid question? Pinmembersharkbc15:44 17 Feb '12  
GeneralRe: A stupid question? PinmemberTorstenH.19:57 19 Feb '12  
GeneralRe: A stupid question? Pinmemberjschell10:27 20 Feb '12  
The real problem is that we do not know what you are actually doing.
 
Again the following has always been true regardless of java version for the major java vendors...
 
Equality compares references
The method equals() compares value (content of string.)
 
As I said there are ways which MIGHT present seemingly different results dependent on the specifics of what is going on. But you haven't presented the specifics.
 
And based ONLY on the code you posted you are comparing references for what you refer to "CODE 1". And reference equality will be equal.
 
So what are some possible causes for some other difference for some OTHER code?
1. You were not using a real version of java, it was some odd variant.
2. There was something odd about the way in which your database code worked.
3. There was something odd about your data
4. You misinterpreted what was happening before.
5. The real code would make it explicitly obvious why a difference was occurring.
6. The method intern() was being called somewhere (incorrectly called.)
AnswerRe: A stupid question? PinmemberNagy Vilmos0:45 21 Feb '12  
QuestionRegarding video compression in java Pinmemberadvarun22:39 15 Feb '12  
AnswerRe: Regarding video compression in java PinmemberNagy Vilmos23:41 15 Feb '12  
QuestionJava project Energy Consumption Calculator for data centers (Need Help) PinmemberKashifn4719:54 15 Feb '12  
AnswerRe: Java project Energy Consumption Calculator for data centers (Need Help) PinmvpRichard MacCutchan22:33 15 Feb '12  
AnswerRe: Java project Energy Consumption Calculator for data centers (Need Help) PinmemberTorstenH.4:07 16 Feb '12  
GeneralMessage Automatically Removed Pinmemberajinkyachavan8917:13 15 Feb '12  
QuestionMessage Automatically Removed Pinmemberajinkyachavan8917:12 15 Feb '12  
QuestionMessage Automatically Removed Pinmemberajinkyachavan8917:09 15 Feb '12  
Questionjava code for image segmentation Pinmembersajan_manohari21:50 14 Feb '12  
AnswerRe: java code for image segmentation PinmemberNagy Vilmos22:08 14 Feb '12  
AnswerRe: java code for image segmentation PinmemberBobJanova1:35 15 Feb '12  
Questioniterator problem Pinmemberprithaa6:14 14 Feb '12  
AnswerRe: iterator problem PinmemberTorstenH.19:43 14 Feb '12  
GeneralRe: iterator problem Pinmemberprithaa1:09 15 Feb '12  
GeneralRe: iterator problem PinmemberTorstenH.1:18 15 Feb '12  
GeneralRe: iterator problem Pinmemberprithaa1:25 15 Feb '12  
GeneralRe: iterator problem PinmemberTorstenH.2:13 15 Feb '12  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Beta | 2.5.120517.1 | Last Updated 22 May 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid