Didnot understand the binary system 1's and 2's complement

Sir when you were explaininhg the datatypes you said for a byte the range is 0 to 255 , but the range can also be -127 to 128. But if i give the value 130 to the byte according to the second range should overflow.I am not understanding 1
's and 2’s complement as well .Please clear it sir.

Hi @bhavanamokkapati123_9bb9ec83d3a94f46
The range 0 to 255 is for value in terms of bits(Binary Number System) while in java byte range is -128 to 127
1’s complement :- To get 1’s complement of a binary number, simply invert the given number.
2’s Complement :- To get 2’s complement of binary number is 1’s complement of given number plus 1 to the least significant bit (LSB).
For example 2’s complement of binary number 10010 is (01101) + 1 = 01110.