title: Checking if every char in a string belongs to the given set of chars or not (JAVA)
body: <p>So I need to create a method isValidDNA which works like this:</p>
  <blockquote>
  <p>public boolean isValidDNA()</p>
  <p>Returns true if the DNA is valid, i.e, only contains the letters,
  A,T,C,G (in uppercase) and at least one of these characters.</p>
  </blockquote>
  <p>All I could think of was this, which apparently doesn't work:</p>
  <pre><code>    public boolean isValidDNA(){
      for (int i=0;i&lt;dna.length();i++){
          if (dna.charAt(i)=='A' || dna.charAt(i)=='T' || dna.charAt(i)=='C' || dna.charAt(i)=='G' ){
              return true;
          }
          return false;
      }
  }
  </code></pre>