Created
October 4, 2016 00:39
-
-
Save alvareztech/43fcc9c785e67114241b005d77fb2988 to your computer and use it in GitHub Desktop.
Ejemplo LinkedList en Java
This file contains hidden or 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 tech.alvarez; | |
import java.util.LinkedList; | |
import java.util.ListIterator; | |
public class Main { | |
public static void main(String[] args) { | |
LinkedList<Estudiante> lista = new LinkedList<Estudiante>(); | |
lista.add(new Estudiante("Juan", 85)); | |
lista.add(new Estudiante("Maria", 45)); | |
lista.add(new Estudiante("Pedro", 51)); | |
ListIterator<Estudiante> iterador = lista.listIterator(); | |
while (iterador.hasNext()) { | |
Estudiante e = iterador.next(); | |
System.out.println(e.getNombre()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment