Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: How to Iterate through elements of LinkedList using Iterator

Java: How to Iterate through elements of  LinkedList using Iterator
{filelink=5197}

import java.util.Iterator;
import java.util.LinkedList;
public class Linked_Iter
{
  public static void main(String[] args)
  	 {
    LinkedList lk_Liste = new LinkedList();
    lk_Liste.add("London");
    lk_Liste.add("Tokyo");
    lk_Liste.add("New York");
     // Creating an Iterator on LinkedList
    Iterator itr = lk_Liste.iterator();
    // Displaying items
    while (itr.hasNext())
    {
      System.out.println(itr.next());
    }
  }
}

Users who found this page were searching for:

  • perl iterating "linked list"
  • convert iterator to linked list
  • how+to+create+linked+list+in+java+with+database
  • how to iterate through a linked list in java
  • linked list in java gui
  • iterate through linked list in java
  • function to iterate through linked list
  • how to insert a data into database using linkedlist in java
  • java data structure iterate
  • program linkedlist in java use gui

No comments yet.

Leave a Comment