Skip to content

Instantly share code, notes, and snippets.

@hakaneroztekin
Created August 23, 2019 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hakaneroztekin/abd65f7607008643b149dec6e911bd90 to your computer and use it in GitHub Desktop.
Save hakaneroztekin/abd65f7607008643b149dec6e911bd90 to your computer and use it in GitHub Desktop.
//LinkedList
import java.util.*;
public class TestJavaCollection2{
public static void main(String args[]){
LinkedList<String> al=new LinkedList<String>();
al.add("Ravi");
al.add("Vijay");
al.add("Ravi");
al.add("Ajay");
Iterator<String> itr=al.iterator();
while(itr.hasNext()){
System.out.println(itr.next());
}
}
}
// Output:
// Ravi
// Vijay
// Ravi
// Ajay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment