I'm trying to get the output of 8 through this loop condition but I am getting this value instead:
-2147483648
class Test1 {
public static void main(String [] args) {
int p = 2;
int j=5;
for (int i = p; i < j; i++) {
j++;
}
System.out.println(j);
}
}
Why is it happening and where do I need to look into?