Answered Questions

  • Memory Allocation

    What is the difference between below 2 statements? String s1=new String("abc");String s2="abc";How it will allocate in memory?

    gaurav

    • Jun 15th, 2012

    in String s1 = "Hello World"; // "Hello world" is a constant and it will be allocated in the string pool. all the variables refering to "Hello World" constant will refer to same memory location in th...