Consider the following - an adaptation of your 2D array code:
public static void main(String[] args){
int[][] a = {{1,2},{3,4}};
int[][] b = new int[a.length+1][];
for ( int i = 0; i <...
Type: Posts; User: copeg
Consider the following - an adaptation of your 2D array code:
public static void main(String[] args){
int[][] a = {{1,2},{3,4}};
int[][] b = new int[a.length+1][];
for ( int i = 0; i <...
I'm not sure about the goal here, but if you are wishing for a more dynamic array perhaps use a List. Alternatively you can make your methods more flexible by adding a parameter which allows one to...