Answer the question
In order to leave comments, you need to log in
Why is it impossible to get byte and short in Kotlin when adding variables with the same types?
Why, when adding 2 variables of type Byte and Shor, we get a variable of type Int
If it explicitly indicates what type the variable should be, then it gives an error
Answer the question
In order to leave comments, you need to log in
there is simply no + operation on bytes, since bytes are first converted to integers, and the result of adding two integers is a (32-bit) integer, i.e. int
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question