文字列処理
文字列の比較方法

文字列と文字列を比較する時に、
if(str == "ABC")
と記述するのは間違いで、正しくはStringクラスのequalsメソッドを利用します。

例)
この例では、strが"hoge"なので、"ほげ"では無い時の処理が実行されます。
String str;
str="hoge";

if(str.equals("ほげ"))
{
    .
    .
  //strが"ほげ"の時の処理
    .
    .
}
else
{
    .
    .
  //strが"ほげ"では無い時の処理
    .
    .
}