Click here to Skip to main content
15,890,399 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Java
public class bitwise
{
    public static void main(String args[])
    {
           int x=28;
           System.out.println(~x);
    }
}
Posted
Updated 29-Oct-11 8:18am
v3
Comments
Philippe Mori 29-Oct-11 14:59pm    
~28 would give -29. What are you expecting as the answer.

1 solution

You have used the complement operator; the NOT operator is the exclamation mark !
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900