bitwise inversion of byte and int,”You are actually quite close.In binary , not 0 should be 1Yes, this is absolutely correct when we’re talking about one bit.HOWEVER
an int whose value is 0 is actually 32 bits of all zeroes! ~ inverts all 32 zeroes to 32 ones.source stackoverflow:”