Logical Truth Table Input Values | AND | OR | XOR | NOT |
boolean foo | boolean bar | foo && bar | foo || bar | foo ^ bar | !foo |
false | false | false | false | false | true |
false | true | false | true | true | true |
true | false | false | true | true | false |
true | true | true | true | false | false |
<table class="is-bordered is-striped">
<caption>Logical Truth Table</caption>
<thead>
<tr>
<th colspan="2">Input Values</th>
<th>AND</th>
<th>OR</th>
<th>XOR</th>
<th>NOT</th>
</tr>
</thead>
<tbody>
<tr>
<th><code class="language-java">boolean foo</code></th>
<th><code class="language-java">boolean bar</code></th>
<th><code class="language-java">foo && bar</code></th>
<th><code class="language-java">foo || bar</code></th>
<th><code class="language-java">foo ^ bar</code></th>
<th><code class="language-java">!foo</code></th>
</tr>
<tr>
<th><code>false</code></th>
<th><code>false</code></th>
<td><code>false</code></td>
<td><code>false</code></td>
<td><code>false</code></td>
<td><code>true</code></td>
</tr>
<tr>
<th><code>false</code></th>
<th><code>true</code></th>
<td><code>false</code></td>
<td><code>true</code></td>
<td><code>true</code></td>
<td><code>true</code></td>
</tr>
<tr>
<th><code>true</code></th>
<th><code>false</code></th>
<td><code>false</code></td>
<td><code>true</code></td>
<td><code>true</code></td>
<td><code>false</code></td>
</tr>
<tr>
<th><code>true</code></th>
<th><code>true</code></th>
<td><code>true</code></td>
<td><code>true</code></td>
<td><code>false</code></td>
<td><code>false</code></td>
</tr>
</tbody>
</table>