java - How much space will be reserved for a non genric Arraylist while defining it -


by default when create arraylist without specifying size , create array of 10 elements in memory question is, if create list lst = new arraylist();

how many bytes reserved in memory lst?

the default capacity of arraylist has nothing generics.

if don't specify capacity, default capacity of 10. object array of 10 elements created, filled nulls.

an object array array of object references.

the memory cost of object reference depends on platform program running (typically 8 bytes on 64 bits os, 4 bytes on 32 bits os).


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -