You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this project;
why use "List<IScanIssue> issues = new ArrayList<>()";
when I take it in Elipse ,this will come a error; why not use "List<IScanIssue> issues = new ArrayList<IScanIssue>()" or "List<IScanIssue> issues = new ArrayList()"
My eclipse's verison is 10.0 and java version is 1.7.x
The text was updated successfully, but these errors were encountered:
Disclaimer: I'm not the maintainer or author of the project
This is called Type Inference for Generic Instance Creation or informally diamond operator. (<> looks like a diamond, doesn't it?) It was introduced in Java 1.7, and results in less boilerplate than your first suggestion (new ArrayList<IScanIssue>()) while avoiding the compiler warning generated by your second suggestion (List<IScanIssue> issues = new ArrayList()).
In this project;
why use "
List<IScanIssue> issues = new ArrayList<>()
";when I take it in Elipse ,this will come a error; why not use "
List<IScanIssue> issues = new ArrayList<IScanIssue>()
" or "List<IScanIssue> issues = new ArrayList()
"My eclipse's verison is 10.0 and java version is 1.7.x
The text was updated successfully, but these errors were encountered: