Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2006

Tip: Looking for answers? Try searching our database.

Doubt!!!!!!!!!!!!!!!!

Thread view: 
som - 29 Dec 2006 08:52 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.