From a99fa55539261511d726f3a27876e04e516eb051 Mon Sep 17 00:00:00 2001 From: pitzzahh Date: Tue, 11 Oct 2022 22:38:39 +0800 Subject: [PATCH] removed Constructors, initialized Object[] array to an empty array. --- .../util/utilities/classes/DynamicArray.java | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/main/java/io/github/pitzzahh/util/utilities/classes/DynamicArray.java b/src/main/java/io/github/pitzzahh/util/utilities/classes/DynamicArray.java index 81e23a8..1cde19b 100644 --- a/src/main/java/io/github/pitzzahh/util/utilities/classes/DynamicArray.java +++ b/src/main/java/io/github/pitzzahh/util/utilities/classes/DynamicArray.java @@ -22,30 +22,13 @@ public final class DynamicArray implements Serializable { * The array where the elements are stored. * Called balloon because balloon expands as you add air to it. */ - transient Object[] balloon; + transient Object[] balloon = {}; /** * placeholder for any insert modification in the dynamic array. */ transient int modificationCount; - /** - * No args dynamic array. Sets the dynamic array size to default size of 10. - */ - public DynamicArray() { - this.balloon = new Object[] {}; - } - - /** - * Creates a {@code DynamicArray} object with an initial size - * @param initialSize the initial size of the array. - */ - public DynamicArray(int initialSize) { - if (initialSize > 0) this.balloon = new Object[initialSize]; - else if (initialSize == 0) this.balloon = new Object[]{}; - else throw new IllegalArgumentException("Illegal Capacity: " + initialSize); - } - /** * Insert an element in the dynamic array. * @param element the element to be inserted.