1 Reply Latest reply: Apr 23, 2007 8:04 AM by 807606 RSS

    String memory allocation

    807606
      when i am writing the code
      String a="";
      String b = null;
      String c="null";
      what will be the difference in the memory allocation in the heap?
        • 1. Re: String memory allocation
          807606
          there will be 2 string objects created (assuming those strings have not already been interned). one will be the size of a string object, and the other will be the size of a string object plus 4 characters

          why are you so interested in memory allocation and strings? what's your underlying concern?