M
Miss. Michelle Heigardt
Hi, I have a string array
String[] counting={"eine","zwei","drei","vier"};
and I want to increase size to include "five". But I do not want to do it
by modifying the declaration like this:
String[] counting={"eine","zwei","drei","vier","fünf"};
I want to increase the size runtime.
Is there a simpler way of doing this other than
String[] counting={"eine","zwei","drei","vier"};
String[] c=new String[counting.length+1];
for (int i=0;i<counting.length;i++)
c=counting;
c[counting.length]="fünf";
counting=c;
Thank you
Michelle
String[] counting={"eine","zwei","drei","vier"};
and I want to increase size to include "five". But I do not want to do it
by modifying the declaration like this:
String[] counting={"eine","zwei","drei","vier","fünf"};
I want to increase the size runtime.
Is there a simpler way of doing this other than
String[] counting={"eine","zwei","drei","vier"};
String[] c=new String[counting.length+1];
for (int i=0;i<counting.length;i++)
c=counting;
c[counting.length]="fünf";
counting=c;
Thank you
Michelle