I have seen people struggle in handling data in Java when it reaches at the byte level. As Java doesn't support any concept of Un-signed data type, so it makes things more complex. So thought lets share my understanding. Java stores negative values in 2's complement format and to get absolute value of any negative number you need to type cast variable with higher byte value datatype. In simple word, to get absolute value of -ve byte data type variable it need to type cast/upgrade to some other date type (e.g. short/int) having more number of bytes and. Example, byte mSample = 142 ; If you print its value, it will show -114 . So, why does the JVM shows -114 ? Binary of 142 : 1 0 0 0 1 1 1 0 . The left most bit is Signed bit, so JVM considers this number as -ve value and converts it into 2's Complement, which means, 0 1 1 1 0 0 1 0 = - 114. So, its simple, right ? So, to get absolute value of mSample , we need to type cast it to higher byte enabled data type