array-> are of fixed size used very less when you are working in real systemsslice-> are of dynamic size and have better performance then normal array, used most in the real systems
- i guess because they are dynamic and more realiable to use and efficiency is far better than normal fixed array
- i guess you are asking it for the
slice- Case -> when you have enough space
- it just add the element at the end simply
- Case -> when you dont have enough space
- it create a new array of double size generally and copy the rest of the elements to it and do this process if this case hits
- Case -> when you have enough space
len-> the number of elements are there in the slicecap-> the actual reserved size of the slice