-
-
Save uncoded-ro/2bc39ec727e0345ee20a472e7bf5fd56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ro.virtualcampus.list; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
public class AppListIterator { | |
public static void main(String[] args) { | |
String[] nume = {"Ioana", "Ghita", "Maria"}; | |
List lista = new ArrayList(); | |
for (String element : nume) | |
lista.add(element); | |
Iterator<String> i = lista.iterator(); | |
while (i.hasNext()) | |
System.out.println(i.next()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment