calculation for capacity
StringBuffer sbl = new StringBuffer ("Capacity of sb"); System.out.println(sbl.capacity ()); OUTPUT IS 30 capacity of sbl = 14 initial memory allocated = 16 my question is how does the java calculated the capacity?
public StringBuffer (String str) constructs a string buffer initialized to the specified string. The inicial capacity of the StringBuffer is 16 plus the lenght of the string argumento. The capacity is the amount of storage avaliable for newly inserted characters, beyond which an allocation will occur. Every string buffer has a capacity. As long as The lenght of the characters sequence contained in the string buffer does not exceed the capacity, it is not necessary to allocate a new internal buffer array. If internal buffer overflows, it automatically made larger.
Thanks for the answer. excuse me, it will automatically or we have to initialize ourself the storage for capacity?
Please help me with HTML
What is the mistake here?
Unable to overload +
I have tried every way I could find but still I can't display my local images ..what am I doing wrong?
Pls rectify the errors.
Python list half printed