From 17ae763c6cf4fb1bf538310291d06da5c3143e26 Mon Sep 17 00:00:00 2001 From: efischer Date: Wed, 23 Feb 2022 10:37:40 -0600 Subject: [PATCH] Generate populations correctly --- src/main/java/InteractiveInterface.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); }