title: using ! on int in JAVA
body: <p>I was working on a program in java where I was creating a truth table of a full subtractor using a 2 dimensional array. While doing so, I wanted to compute the borrow out with the following formula:
     B(out) =    !(X).Y + (!(X ^ Y))B(in) </p>
  
  <p>So, I wrote it like:</p>
  
  <pre><code>table[i][4] = ((!(table[i][2]))&amp;table[i][1])+((!(table[i][2]^table[i][1]))*table[i][0]);
  
  (here: table[i][4] = cell to store borrow out; 
         table[i][2] = cell storing X; 
         table[i][1] = cell storing Y; 
         table[i][0] = cell storing borrow in B(in) )
  </code></pre>
  
  <p>Whereas XOR(^) and AND(&amp;) and or(|) worked fine, I got the following error for NOT(!):</p>
  
  <pre><code>operator ! cannot be applied to int 
  </code></pre>
  
  <p>How can I correct this? Is there any other way to write this formula as a JAVA code? Please help. </p>