-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
8
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
While I am reading the Documation on Generics topic (Interoperating with Legacy Code) in official page. I found a minor syntax issue on creating LinkedList object. please find the link of document and the piece of code which has error below.
https://docs.oracle.com/javase/tutorial/extra/generics/legacy.html
public String loophole(Integer x) {
List ys = new LinkedList; //error line missing parenthesis
List xs = ys;
xs.add(x);
return(String) ys.iterator().next(); // run time error
}
While I am reading the Documation on Generics topic (Interoperating with Legacy Code) in official page. I found a minor syntax issue on creating LinkedList object. please find the link of document and the piece of code which has error below.
https://docs.oracle.com/javase/tutorial/extra/generics/legacy.html
public String loophole(Integer x) {
List ys = new LinkedList; //error line missing parenthesis
List xs = ys;
xs.add(x);
return(String) ys.iterator().next(); // run time error
}