I am new to java. I am just experimenting. When I try to convert this code with javac it gives my an error
error: Cannot find symbol
System.out.print(res);
^
symbol: variable res
Here is the full code:
class forarray {
public static void main(String[] args) {
int arr[][] = { { 1, 2, 3 }, { 5, 6, 7 } };
for (int res = 0; res + arr[1][2] <= 10; res++) {
if (res == 2) {
res += 15;
} else {
res += 1;
}
}
System.out.print(res);
}
}