I am using eclipse juno for my project. I am trying to do convert from String array to integer array. For this expressions, I am using below code.
String[] c1 = {"5","4","2","1"}; int[] c = Arrays.stream(c1).mapToInt( Integer::parseInt()).toArray();
how to remove this error in eclipse. please can any one help me please.
change it to
int[] c = Arrays.stream(c1).mapToInt(Integer::parseInt).toArray();
no need of round brackets (parenthese) for method references Integer::parseInt
is enough
Eclipse Juno does not support lambdas (or Java 8 in general). You need to be using Eclipse Mars (or Luna) for full Java 8 support.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.