I am trying simple linked list Collection program, but it is not giving me out put.
i created this stuff
import java.lang.*;
import java.util.*;
cla
I executed your program through eclipse :
Just use LinkedList
instead of just LinkedList. No Warnings.
Output =>
CONTENTS OF l1 = []
SIZE = 0
CONTENTS OF ll = [10, 20, 30, 40]
SIZE = 4
SUM USING toArray () = 100
CONTENTS OF ll = [6, 5, 10, 20, 30, 40]
SIZE = 6
SUM USING iterator () = 111
6,5,10,20,30,40,
Exception in thread "main" java.util.NoSuchElementException
at java.util.LinkedList$ListItr.next(Unknown Source)
at com.Linkedlist.main(Test.java:46)