title: Java: Changing a Binary number like 1010 and reversing the bits. 1010 = 0101. 0's to 1's and 1's to 0's
body: <p>I have been searching around the web and seems like I can never seem to find the answer to this question. How do you change the bits in a binary number? </p>
  
  <blockquote>
    <p>Example: say I got 1010 and I want to change the numbers 0's to 1's and 1's to 0's.</p>
  </blockquote>
  
  <p>Right now, I have the binary number in a integer. </p>
  
  <p>I'm completely stumped, if anyone could help me thank you.</p>
  
  <p>Sorry if people are confused from my question . What i want to do is change the numbers 0's to 1's and 1's to 0's . </p>