How to create LinkedList in Java?
The following line is used to create LinkedList.
LinkedList
package com.mindclues; import java.util.LinkedList; public class LinkedListCreation { public static void main(String[] args) { LinkedListlinkedList = new LinkedList (); linkedList.add("B"); linkedList.add("C"); linkedList.add("D"); linkedList.add("E"); System.out.println(" Linked List : " + linkedList); } }
Linked List : [B, C, D, E]
post a comment