Originally posted by Bharatesh H Kakamari:
String s1 = new String("amit"); // allocated from heap
String s3="arit"; //allocated from String pool
String s4="arit"; // no new reference created
String s2 = s1.replace('m','r'); // AS "arit" ALREADY EXISTS, SHOULD IT NOT BE ALLOCATED REFERENCE OF s3 ?
System.out.println(s2==s3);
System.out.println(s3==s4);
WHY DOES IT PRINT "false" FOR FIRST SOP ?
Originally posted by ravi chan:
. . . And also a thing to note is you cannot change the overloaded declaration to float Firstfunc(long a, long b, long c)
will give you a compiler error if your method call is Firstfunc(1, 2, 3) because the compiler gets confused about both the overloaded methods.
Originally posted by AVNI R:
[B]Thanks Ajit......
Ajith. I have two doubts here.......
1. Where does a literal(any literal-int,boolean,string etc)belong to.. Is it belonging to primitive datatypes? If yes then why do we have literals in the first place.... Can't we do without it..
2. In this example why cant we compare a string literal to an object reference in (1)? Why is it giving false... and why it is giving true at (2)...........
Mysterious strings.........
AVNI
[/B]
</BLOCKQUOTE>
[This message has been edited by Gautam Pandya (edited October 30, 2000).]
[This message has been edited by Gautam Pandya (edited October 30, 2000).]
Originally posted by Aru Ven:
Hi All,
Can anyone tell me why the Runtime Exceptime thrown in the first catch statment not caught in the immediate next Catch. I mean....
Aruna