[Advanced-java] Performances

Marco Ferretti marco.ferretti at jrc.it
Thu Jul 3 15:07:02 2003


I there guys, I wonder if someone can point me somewhere. I have always
coded boolean evaluation on strings like :=0D
String foo =3D "123";=0D
if(foo.equals("456") ){=0D
    ...=0D
}=0D
probably because I code as I think (if the variable equals something ....=
).=0D
I took a look at sun's code for jdk and always saw the above as =0D
String foo =3D "123";=0D
if("ss".equals(foo) ){=0D
    ...=0D
}=0D
=0D
So : is there some reason (eg. performance) why I should change the way I
always coded such things ?=0D
=0D
TIA=0D
    Marco