Why bitwise operation (~0); prints -1 ? In binary , not 0 should be 1 . why ?
(~0);
What you are actually saying is ~0x00000000 and that results in 0xFFFFFFFF. For a (signed) int in java, that means -1.