Q:

Java Program to Iterate through the elements of a linked list at the any position

0

Program to Iterate through the elements of a linked list at the any position

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import java.util.*;
public class demo1 
{
 public static void main(String[] args)
 {
  LinkedList<String> link_list = new LinkedList<String>();
  link_list.add("C#");
  link_list.add("C++");
  link_list.add("Java");
  link_list.add("Python");
  link_list.add("Perl");
  link_list.add("Ruby");

  Iterator i = link_list.listIterator(2);
  while (i.hasNext()) 
  {
   System.out.println(i.next());
  }
 }  
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now