Programming, Java, Lists, Data Structures.
only option is to create a new array with the bigger size and copy the elements from the old one. //We can achive this using Arrays.copyOf() function int [] marksNew = Arrays.copyOf(marks, 7); marksNew[5] = 65; marksNew[6] = 87; Wait, don’t we have to do it every time we need to add a new score?