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