1

I wonder why in Java some of these work, while some do not. Last ones are getting "Required char, found int" error.

int n = 5;
char c = 'A'; //works ok
c++; //works ok
c += n; //works ok
c += 5 - n; //works ok
c = 15 + 65; //works ok
c = 5 + n; //doesn't work
c = c + 1; //doesn't work
luk2302
  • 50,400
  • 22
  • 92
  • 131
The Rain
  • 11
  • 1

0 Answers0