Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
You can for example like this:
public static void main(String[] args) {
Random r = new Random();
int[] fiveRandomNumbers = r.ints(5, 0, 100).toArray();
int item = Arrays.stream(fiveRandomNumbers).max().getAsInt();
System.out.println(Arrays.stream(fiveRandomNumbers).boxed().collect(Collectors.toList()) +" - "+ item);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question