I am new in java language, here is m not able to understand, why program returning -2 after adding two full range integers.
class Variables {
public static void main(String[] args) {
int a = 2147483647;
int b = 2147483647;
long c = a + b;
System.out.println( c );
}
}
I am expacting 4294967294 value in my variable c, but why it returns -2 please explain me the reason behind this