• Post Reply Bookmark Topic Watch Topic
  • New Topic

ArrayList default size?  RSS feed

 
Sarah Holland
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ArrayList list = new ArrayList();

I know this creates an ArrayList with space for default number of elements, but what is the default size for Java 8?
 
Stephan van Hulst
Saloon Keeper
Posts: 7987
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the API docs for Java 8, it says right there.

By the way, don't use raw generic types. you should parameterize your ArrayList.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!