I wrote two versions of Java code to increment a char variable by 1:
version1:
char c = 'a';
c = c + 1;
version2:
char c = 'a';
c += 1;
To my surprise, the second version compiles and runs successfully but the first one shows an error, which says incompatible types: lossy conversion from int to char. Why are they different?