What are the main differences between different loops when it comes to coding ?

This question is relevant to different coding languages, and it can be easily explained using Java language : for instance, we will use an integer array called FOR:for(int i=0;i<ArrayList.size();i++) the same line can be expressed using an enhanced loop to iterate Java array called FOR EACH:for(integer number : ArrayList) Both loops will go through each INTEGER element from the ArrayList, the first one having more flexibility.

GB

Related Computing A Level answers

All answers ▸

What is the difference between a dynamic and a static data structure?


Express the number 208 as a) an 8-bit binary number b) an octal string c) a hexadecimal string


When a stack is implemented using a 1-D array, adding a valid item can cause an execution error. Explain why an execution error can occur in this situation.


Why indentation is important in Python and what is the scope of a global variable?