I have an array:
int[] array = new int[] {10, 20, 30, 40, 50, 60, 70, 80, 90, 100};
I need to bring all the elements of the array to the console, I understand that for this we need a cycle:
for (int i = 0; i < 10; i++) { System.out.println(array[i]); }
And what if we add several elements, let's say:
int[] array = new int[] {10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 101, 102, 103};
How to sort through all these elements, constantly change the condition i <... That's actually the question, how to sort through the array of elements without knowing how many elements are there? :)