Click here to watch in Youtube : https://www.youtube.com/watch?v=-UQw_YRP72c
LinkedListForEachExample.java
import java.util.LinkedList; public class LinkedListForEachExample { public static void main( String[] args ) { LinkedList<Integer> linkedList = new LinkedList<Integer>(); linkedList.add(100); linkedList.add(200); linkedList.add(300); linkedList.add(400); /* * Using for-each loop getting each element from the linkedList. */ for( Integer value : linkedList ) { System.out.println(value); } } }
100 200 300 400
https://sites.google.com/site/javaee4321/java-collections/LinkedListDemoForeach.zip?attredirects=0&d=1
See also:
No comments:
Post a Comment