Can anyone please point me what I am missing over in the below statements?
Warning 1
prog.java:16: warning: [unchecked] unchecked conversion
adj = new LinkedList[v];
^
required: LinkedList<Integer>[]
found: LinkedList[]
Warning 2
prog.java:18: warning: [unchecked] unchecked conversion
adj[i] = new LinkedList();
^
required: LinkedList<Integer>
found: LinkedList
Warning 3
prog.java:43: warning: [unchecked] unchecked call to push(E) as a member of the raw type Stack
stack.push(new Integer(v));
^
where E is a type-variable:
E extends Object declared in class Stack
help me to recover this warning.Thanks in advance
PC :- keep_smiling
warning 1 and 2 arises because you are not using generics properly.Cast your LinkedList to a generic type rather than raw type e.g
LinkedList <Integer>.
I cant tell about the third as you should provide the code tempelate.