Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C#

List

lockCombination has a capacity of after running the following code.

List lockCombination = new List();

lockCombination.Add(12); lockCombination.Add(42); lockCombination.Add(13);

In this case capacity will be 4. By default capacity is zero, as soon as we add a item in it init with 4, and after reaching this point it get increased again to 8. here you have added three item only so it should 4.

2 Answers

In this case capacity will be 4. By default capacity is zero, as soon as we add a item in it init with 4, and after reaching this point it get increased again to 8. here you have added three item only so it should 4.