Click here to watch in Youtube : https://www.youtube.com/watch?v=uicImeoxgP0
LinkedListExample.java
Output
LinkedListExample.java
import java.util.HashSet; import java.util.LinkedList; /* * Example of LinkedList(Collection<? extends E> c) Constructor. */ public class LinkedListExample { public static void main( String[] args ) { HashSet<Integer> hashSet = new HashSet<Integer>(); hashSet.add(100); hashSet.add(200); hashSet.add(300); System.out.println("hashSet : " + hashSet); /* * Constructs a list containing the elements of the specified * collection, in the order they are returned by the collection's * iterator. */ LinkedList<Integer> linkedList = new LinkedList<Integer>(hashSet); System.out.println("linkedList : " + linkedList); } }
hashSet : [100, 200, 300] linkedList : [100, 200, 300]
To Download LinkedListDemoParamCons Project Click the below link
https://sites.google.com/site/javaee4321/java-collections/LinkedListDemoParamCons.zip?attredirects=0&d=1
See also:
No comments:
Post a Comment