I noticed few things: 1. by default all the array notations for list are null and when you have list of size 4 which is Index {0,1,2,3) - value {null,null,null,null} and if you add the value for ex. L4[3] = 8; then it becomes {null,null,8,null}. 2. Now if i have this list {null, 3 , 8, null} , then i remove L4.remove(3); then it becomes {null,3,null} , which means the position itself gets removed and replaced by next value. 3. after performing L4.clear(); I was not able to add any value to this List, is there any way to over ride that?
I noticed few things:
1. by default all the array notations for list are null and when you have list of size 4 which is Index {0,1,2,3) - value {null,null,null,null} and if you add the value for ex. L4[3] = 8; then it becomes {null,null,8,null}.
2. Now if i have this list {null, 3 , 8, null} , then i remove L4.remove(3); then it becomes {null,3,null} , which means the position itself gets removed and replaced by next value.
3. after performing L4.clear(); I was not able to add any value to this List, is there any way to over ride that?
L4[0] = 1; syntax to replace a value at 0th index.
Or, also, you check the list methods in documentations.
Amazing
Thanks
In Array notation list what will the
Default values of list without adding values ???
The default values of the Array notation list will be null.
Default values for list will be Null