SCJP 5.0<br /> <br />"Skills are started with learning and mastered with improvement. Nothing is hereditary except death" BUDDHA...
Originally posted by srinivas sridaragaddi:
Hi,
ans:
i1 == i2, returns False in both the cases explain.
1) In the first case i understand
that both the statments are completly different. But i thought to save memory i2 would be
refering to i1.
2) i2 with Integer.valueof() would be expecting a integer value but its a string out there
i thought i would result in a compilier error. but it didnt happen.
I think both needs the knowledge of API. I was unable to sort out.
Please explain.
Thanks in advance![]()
In the first case i understand that both the statments are completly different. But i thought to save memory i2 would be refering to i1.
SCJP 5.0<br /> <br />"Skills are started with learning and mastered with improvement. Nothing is hereditary except death" BUDDHA...
SCJP 5.0<br /> <br />"Skills are started with learning and mastered with improvement. Nothing is hereditary except death" BUDDHA...
i thought String s="abc" is a short cut or alias of
String s=new String("abc") is that correct or not. Now i am getting confused .
MooN
i thought String s="abc" is a short cut or alias of
String s=new String("abc") is that correct or not.
because Strings are used frequently in code you can create one using a string literal directly.
SCJP 5.0<br /> <br />"Skills are started with learning and mastered with improvement. Nothing is hereditary except death" BUDDHA...
SCJP 5.0<br /> <br />"Skills are started with learning and mastered with improvement. Nothing is hereditary except death" BUDDHA...
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |