for-each ( : )Iterates over each element of an array/list.Syntaxfor (type e : arr) { }DescriptionIterates over elements without dealing with indices.ExampleLoading editor…▶ Try it yourselfExpected outputred purpleWhen to use?Iterating collections.Related commandsfor← forwhile →