I am unable to understand how the following code gives -12. Please help me.
int a=11;
int result=~a;
System.out.println(result);
I thought it will give 4. but yes I saw a preceding zero.
I guess it has got something to do with 2's complement but cant makes out how.