Skip to content

Instantly share code, notes, and snippets.

@alvareztech
Created October 4, 2016 00:39
Show Gist options
  • Save alvareztech/43fcc9c785e67114241b005d77fb2988 to your computer and use it in GitHub Desktop.
Save alvareztech/43fcc9c785e67114241b005d77fb2988 to your computer and use it in GitHub Desktop.
Ejemplo LinkedList en Java
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