How the array size is auto increment in java program my requirement is "create a 2 dimensional array sno, in the first dimension name, age in the second dimension so if i pass sds, 25 it should be added to the array [0][sds,25] the array should keep incrementing" my code is like this:
void values() throws IOException{for ( int row = i; row < len; row++ ){
for ( int column = 1; column <= 1; column++ ){
arrayValues[row][0] = String.valueOf(row+1);
System.out.print("Enter "+(row+1)+" Name: ");
String name = br.readLine();
System.out.print("Enter "+(row+1)+" age: ");
int age = Integer.parseInt(br.readLine());
arrayValues[row][column]= name+","+age;
}
void incrementSize() throws IOException{String[][] newArray = new String[arrayValues.length][];
System.out.println(newArray.length);
String[][] t = Arrays.copyOf(arrayValues, newArray.length);
After this how can done my code Please help me