given the following:
public class CharTest {
public static void main (String args[ ])
{
char c = ‘c’;
char r = ‘r’;
c+=r;
c=c+r;
}
}
How come c+=r; compiles, yet c=c+r; doesn’t, complaining about a possible loss of precision by widening r to an int?
Isn’t the += operator just a shorthand notation?