Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Kaua Costa   on May 20 In Java Category.

  
Question Answered By: Barabas Cohen   on May 20

public static String[] resizeArray(String[] array, int newSize){
if(newSize<array.length) return array;
String newArray[] = new String[newSize];
for(int i=0; i<array.length; i++){
newArray[i] = array[i];
}
return newArray;
}

myArray = resizeArray(myArray, 30);

Share: