题目:
解法一(for):
package exercism;
public class Hamming {
public int hammingDistance = 0;
static final char[] dnaElements = {
'G','A','C','T'};
public Hamming(String DNA1, String DNA2) throws InvalidDNAException {
if (DNA1 == null || DNA2 == null) {
throw new IllegalArgumentException(" DNA can not be null");
}
if (!checkIfVaild(DNA1,DNA2)) {
throw new InvalidDNAException("Invalid DNA Sequence "