title: JAVA - logical operations on chars
body: <p>I am creating a file reading program. I need to filter out any char that is not '0-9' or '.'.</p>
  
  <p>Any char other then these needs to trigger an IF statement.</p>
  
  <p>Here is what I tried -</p>
  
  <pre><code>if  ( ( ((char)c &lt; '0') || ((char)c &gt; '9') ) || ((char)c != '.') )
  </code></pre>
  
  <p>or-</p>
  
  <pre><code>( ( ((char)c != '0' ) || ((char)c != '.' ) || ((char)c != '1' ) || ((char)c != '2' ) || ((char)c != '3' ) || ((char)c != '4' ) || ((char)c != '5' ) || ((char)c != '6' ) || ((char)c != '7' ) || ((char)c != '8' ) || ((char)c != '9' ) ))
  </code></pre>
  
  <p>neither of which worked.</p>