I am trying to make the following code or something similar to work:
static String[][] arr = new String[4][4];
static int[][] arr2 = new int[4][4];
for(int i = 0; i < arr.length; i++){
for (int j = 0; j < arr[0].length; j++) {
arr[i][j] = "1";
arr2[i][j] = Integer.parseInt(arr[i][j]);
if(arr2[i][j] instanceof int){
System.out.println("Works");
}
}
}
Instead the IDE marks it red and gives an error "Inconvertible types; cannot cast int to int".
Can somebody help?