[Solved] I cannot process chars [closed]


Instead of setting a character variable which is discarded, I assume you want to use this character to build a new String.

StringBuilder sb = new StringBuilder();
for (char ch : dna.toCharArray()) {
    switch (ch) {
        case 'A': sb.append('T'); break;
        case 'T': sb.append('A'); break;
        case 'G': sb.append('C'); break;
        case 'C': sb.append('G'); break;
    }
}
String dna2 = sb.toString();

1

solved I cannot process chars [closed]