I have a question - how mwmory is allocated when any data structure is declared?
Suppose I have declared a list as follows -
List<Integer> lst = new ArrayList<Integer>();
How many bytes will be allocated for that variable or initially no memory will be allocated? Memory will be allocated when the list will be in use?