Java LinkedList : get()

The get() method Returns the element at the specified position in linkedlist.

Program

0

 

 

 

Program Source

import java.util.LinkedList;

public class Javaapp {

    public static void main(String[] args) {
        
        LinkedList list1 = new LinkedList();
        list1.add("AAAA");
        list1.add("BBBB");
        list1.add("CCCC");
        list1.add("DDDD");
        list1.add("EEEE");
        list1.add("FFFF");
        
        for(int i=0;i < list1.size();i++)
        {
            System.out.println(list1.get(i));
        }
    }
}

Leave a Comment