Being somewhat new to the Java language I\'m trying to familiarize myself with all the ways (or at least the non-pathological ones) that one might iterate through a list (or
You can use forEach starting from Java 8:
List nameList = new ArrayList<>( Arrays.asList("USA", "USSR", "UK")); nameList.forEach((v) -> System.out.println(v));