I tried:
Stream stream = Pattern.compile(" ").splitAsStream(sc.nextLine()); stream.forEach(item) -> {}); and got:
Compilation Error... File.java uses unchecked or unsafe operations. Recompile with -Xlint:unchecked for details. so I tried:
Stream stream = Pattern.compile(" ").splitAsStream(sc.nextLine()); stream.forEach((String item) -> {}); and got:
Compilation Error... 15: error: incompatible types: incompatible parameter types in lambda expression stream.forEach((String item) -> {}); ^ Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1 error How can I make this .forEach() pass compilation?