I wrote a simple program in which I have a bitwise operator which gives the signed value in java. But when I do so it returns a value higher different than the original value.
class bit
{
public static void main(String[] args)
{
int j=10;
System.out.println("jjjj"+~j);
}
}
Gives the output has:
-11. Which the expected output should be -9. What is the problem?