View RSS Feed

Java String

All about Java String.

  1. Memory usage of StringBuilder and StringBuffer

    by , 04-26-2012 at 06:39 PM
    The implementation of these classes is essentially done in similar manner through the shared subclasses & usage of their memory is also same. Difference comes when the turn of those methods come that are present at StringBuffer get synchronized. Here they will be referred as the string buffers generically for sake of simplicity however; comment at the usage of memory will be applied to both classes.

    Objectís overhead is required by the string buffer, space for sake of int field ...
  2. StringBuffer

    by , 04-26-2012 at 06:36 PM
    Thread safed & mutable character sequence. Basically it is just like String however modifications could be done with it. At any time, few specified character sequences are present in it but the content or length of that sequence might be changed via method calls.

    Mutilple threads may use string buffers safely. Synchronization of methods is done where it is considered to be an important thing hence all operations that take place at some specific instance would behave like they ...
    Tags: stringbuffer Add / Edit Tags
    Categories
    StringBuffer