This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The "==" operator compares two variables (Strings or otherwise) to see if they refer to the same physical object -- the same location in RAM. The equals() method, on the other hand, is generally implemented to compare two objects for the more conventional definition of equality -- i.e., two different String objects with the same contents are equals(), but not ==. You want to use "if (string[i].equals("A"))" here.
Have a look at this and this on our "Campfire Stories" page if you don't understand what I'm talking about.