protected String[] getImages(int max, String imageId) {
String[] images = new String[max];
for (int i = 0; i < max; i++) {
images[i] = imageId;
}
return images;
}
Is there a simpler way to fill the contents of a dynamic array based on a constant data a single call. I remember a utility method from commons-lang, but I am unable to re-collect what that call was?
Try using the
Arraysutility class:(That is
fill(Object[] objects, Object val). As you can see from the Javadoc there are many other overloads offill().)