diff --git a/src/main/java/InteractiveInterface.java b/src/main/java/InteractiveInterface.java index 90a2246..8c4fa6e 100644 --- a/src/main/java/InteractiveInterface.java +++ b/src/main/java/InteractiveInterface.java @@ -175,10 +175,10 @@ public class InteractiveInterface { throw new InputMismatchException("Max well population must be greater than min well population"); } //maximum should be inclusive, so need to add one to max of randomly generated values - populations = (Integer[]) rand.ints(minPop, maxPop + 1) + populations = rand.ints(minPop, maxPop + 1) .limit(numSections) .boxed() - .toArray(); + .toArray(Integer[]::new); System.out.print("Populations: "); System.out.println(Arrays.toString(populations)); }