How to calculate range of any datatype while casting it
For example, a question in my paper came like this
in java: byte’s range is -128 to 127
byte x = (int) 300;
what will be the value of x?
How can I calculate this thing on paper?