i need some help regarding adding values into an array
for example
long[] s = new long[] {0, 1, 2};
when i do this i instantiate an
You cannot append values to array dynamically as the memory space is allocated to array object at the time of initializing, it means pre defined consecutive memory location is allocated.Hence we need to use array list because it uses linked list data structure internally and allows you to add/remove/sort easily without wasting any memory space.