if (string1 == string2) { System.out.println(same); } else { System.out.println(different); }