From 67b5a3746f2e36eddd54af25e705f9c0772e8230 Mon Sep 17 00:00:00 2001 From: Tim L Date: Mon, 8 Jul 2024 09:34:47 -0400 Subject: [PATCH] finished basic array utils --- .../assessment1/part1/BasicArrayUtils.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/zipcodewilmington/assessment1/part1/BasicArrayUtils.java b/src/main/java/com/zipcodewilmington/assessment1/part1/BasicArrayUtils.java index ef714b5..a824f97 100644 --- a/src/main/java/com/zipcodewilmington/assessment1/part1/BasicArrayUtils.java +++ b/src/main/java/com/zipcodewilmington/assessment1/part1/BasicArrayUtils.java @@ -9,7 +9,8 @@ public class BasicArrayUtils { * @return the first element in the array */ public static String getFirstElement(String[] stringArray) { - return null; + return stringArray[0]; +// return null; } /** @@ -17,7 +18,8 @@ public static String getFirstElement(String[] stringArray) { * @return the second element in the array */ public static String getSecondElement(String[] stringArray) { - return null; + return stringArray[1]; +// return null; } /** @@ -25,7 +27,8 @@ public static String getSecondElement(String[] stringArray) { * @return the last element in the array */ public static String getLastElement(String[] stringArray) { - return null; + return stringArray[stringArray.length -1]; +// return null; } /** @@ -33,6 +36,7 @@ public static String getLastElement(String[] stringArray) { * @return the second to last element in the array */ public static String getSecondToLastElement(String[] stringArray) { - return null; + return stringArray[stringArray.length -2]; +// return null; } }