Basic to Advance ways to iterate over a List in Java

how you can iterate over a List, be it ArrayList, LinkedList or any other. Basic loop…