-1

When it converts to int implicitly - the result is obvious, but when it adds bytes - it`s different, why? enter image description here

Vita
  • 55
  • 7

1 Answers1

4

Your code just overflows byte — it supports integer values from 0 to 255. You should use at least short.

SNBS
  • 671
  • 2
  • 22