java - cannot find symbol...? -


this question has answer here:

i have write code takes in string of 3 letters , converts give complement dna (a==t, c==g , reverse) string.

although think code okay, keeps giving me same error

"cannot find symbol"

at string dna (main method), twice in method header of watsoncricktripletcompliment. know going wrong

public class dnautilities {         public static void main (string[] args) {       string dna = "agt"; //cannot find symbol              system.out.println (watsoncricktripletcomplement(dna));   }    public static string watsoncricktripletcomplement (string dna) { /*cannot find symbol @ both string*/     stringbuilder builder = new stringbuilder();          if (dna.length() > 3 || dna.length() < 3 )       return "";              else {        for(int i=0; i<3; i++){         char c = dna.charat(i);         if(dna.charat(i) == 't'){             builder.append('a');         }         if(dna.charat(i) == 'a'){             builder.append('t');         }         if(dna.charat(i) == 'c'){             builder.append('g');         }         if(dna.charat(i) == 'g'){             builder.append('t');         }        return builder.tostring();                }   } } } 

  1. i assuming java, since not language is.
  2. the word "string" in lowsercase. need spell string.

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -