The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Help with counter controlled while loop please!

Write program which reads two DNA sequences and then prints their Hamming distance.
The Hamming distance is the number of one to one character mismatches between the two sequences.
You are required to use a while counter controlled loop.

Hint: Use the following methods from the String class: charAt( ), length( ).

I know how do all of the basic setting up but I am confused on how to set up the counter controlled while loop so that it compares the two strings and counts how many differences there are. pleeeease help!

Their you go, your while loop, check if their the same and do stuff. You might need more, but this is your basic loop. I would of explained it, but it was easier to show you. Don't copy it directly, because its probably has errors .. just the idea.