how does capacity is calculated? | Sololearn: Learn to code for FREE!


how does capacity is calculated?

2/14/2017 4:59:18 PM

Adzreel Zeequanil Martadam

2 Answers

New Answer


Which capacity? Publish your code at the playground, then we can try to help you.


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?