Answers for "how to make an array with a set size in java"

2

how to increase the size of array in java

// Use this function
public void increaseSize() {
   String[] temp = new String[original.length + 1];
   
   for (int i = 0; i < original.length; i++){
      temp[i] = original[i];
   }
   original = temp;
}
Posted by: Guest on March-27-2022

Code answers related to "how to make an array with a set size in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language