how does capacity is calculated? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how does capacity is calculated?

14th Feb 2017, 4:59 PM
Adzreel Zeequanil Martadam
Adzreel Zeequanil Martadam - avatar
2 Answers
+ 3
Which capacity? Publish your code at the playground, then we can try to help you.
14th Feb 2017, 6:31 PM
Tashi N
Tashi N - avatar
0
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?
16th Feb 2017, 8:03 AM
Adzreel Zeequanil Martadam
Adzreel Zeequanil Martadam - avatar