how many objects r created

Discussion in 'Java' started by shyam_oec, Feb 24, 2008.

  1. shyam_oec

    shyam_oec New Member

    Joined:
    Nov 26, 2007
    Messages:
    89
    Likes Received:
    1
    Trophy Points:
    0
    Occupation:
    Software Developer, .NET Framework
    Location:
    Jamshedpur
    1. StringBuffer s1 = new StringBuffer("abc");
    2. StringBuffer s2 = s1;
    3. StringBuffer s3 = new StringBuffer("abc");
    How many objects are created ?
     
  2. dilip.klose

    dilip.klose New Member

    Joined:
    Mar 10, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    three objects are created
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice