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

Discussion in 'Java' started by som, Dec 29, 2006.

  1. som

    som Guest

    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
     
    som, Dec 29, 2006
    #1
    1. Advertising

  2. On 29.12.2006 09:52 som wrote:
    > 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?


    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
     
    Thomas Kellerer, Dec 29, 2006
    #2
    1. Advertising

  3. som

    som Guest

    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
     
    som, Dec 29, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Igbal

    Doubt to go .Net technology

    Igbal, Nov 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    508
    Ed Kaim [MSFT]
    Nov 17, 2003
  2. Bob Nelson

    doubt about doubt

    Bob Nelson, Jul 28, 2006, in forum: C Programming
    Replies:
    11
    Views:
    641
  3. Replies:
    0
    Views:
    581
  4. Peter Otten
    Replies:
    2
    Views:
    131
    Cousin Stanley
    Aug 10, 2013
  5. Terry Reedy
    Replies:
    0
    Views:
    123
    Terry Reedy
    Aug 10, 2013
Loading...

Share This Page