import java.util.Arrays;
public class StreamsMax {
public static void main(String[] args) {
int arr[]= {1,2,3,4,5,6,7,8,9,10};
int sum = Solution.maxUsingStreams(arr);
System.out.println(sum);
}
}
class Solution {
public static int maxUsingStreams(int[] arr) {
int s = Arrays.stream(arr).max().getAsInt();
//int p = Arrays.stream(arr).reduce(Integer::max).getAsInt();
return s;
}
}
< /code>
vscode дает эту ошибку < /p>
Исключение в потоке "Main" java.lang.nosuchmethoderror: 'int solution.maxusingStreams (int [])'
at wreamsmax.main (streamsmax.java:10) < /p>
compling. Не могу понять проблему.
Подробнее здесь: https://stackoverflow.com/questions/796 ... pile-and-r