I am using Java and new to it.
When I try
int integerValue = 100;
long longValue = 100;
integerValue = integerValue + longValue;
I get "Type mismatch: cannot convert from long to int".
But
integerValue+=longValue;
works fine, which means it is doing the cast for me :)
Is it something that "+=" provides inherently? Any specific reason for that?
Edit: Oops!! Too common question! :) I should have thoroughly searched first, my bad!!