Hi,
I am new to this group and learning Java, i have a doubt can any one
answere to this Q!
When we use the binary string concatenation operator (+), how many
String
Objects will be
created?
String zero = "zero";
char one = "1";
Float ten = 10.1;
String first = zero + "second" + 2 + "third" + 3 + one + ten;
At run time, when the above line of code is executed, how many objects
will
be created?
Regards
Soumya
Thomas Kellerer - 29 Dec 2006 08:58 GMT
> Hi,
>
[quoted text clipped - 15 lines]
> will
> be created?
You should also learn to use search engines in the internet. One of the
first hits when searching for "java string concatenation" is:
http://java.sun.com/developer/JDCTechTips/2002/tt0305.html
som - 29 Dec 2006 09:27 GMT
Thanks its really good, In shrt i wanted to know the imporatnce of +
operator in Java, now i am clear, it is used to concatenate strings and
in integer it acts as an additional operator!
Soumya. G