Section 14.4 Class StringBuilder
• Class StringBuilder provides constructors that enable StringBuilders to be initialized with no characters and an initial capacity of 16 characters, with no characters and an initial capacity specified in the integer argument, or with a copy of the characters of the String argument and an initial capacity that’s the number of characters in the String argument plus 16.
• StringBuilder method length (p. 612) returns the number of characters currently stored in a StringBuilder. StringBuilder method capacity (p. 612) returns the number of characters that can be stored in a StringBuilder without allocating more memory.
• StringBuilder method ensureCapacity (p. 613) ensures that a StringBuilder has at least the specified ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access