How JVM creats String object

Discussion in 'Strings, I/O, Formatting, Parsing' started by sekhar.raavi, Nov 5, 2009.

  1. sekhar.raavi

    sekhar.raavi New Member

    we create objects in fore ways...
    1)By using new operator.
    2)Factory methods.
    3)class.forName();
    4)cloning mechanism.
    but when we write String s="shekar";
    how the object is create...
    is jvm use another way
     
  2. priyanjan

    priyanjan New Member

    When JVM find String object to be created as String s = "chetna", then it does not create this object in heap memory rather it puts this object into the String pool.String pool is managed by String class.
     
  3. padamalacharan

    padamalacharan New Member

    Hi there!
    Can u explain any one that how the string class will manage string pool? with an example.
     
  4. anoop.chiliveri

    anoop.chiliveri New Member

    What is Factory methods and Cloning mechanism?
     
  5. ihdubus

    ihdubus New Member

    please see the attachment
     

    Attached Files:

Share This Page