class demo{ public static String hello(){
String s1[]={"hello","hello1","hello2"};
String s2[]={"hello","hello1","hello"};
String name;
Boolean x1=!s1[0].equals(s2[0]);
Boolean x2=!s1[1].equals(s2[1]);
Boolean x3=!s1[2].equals(s2[2]);
if (x1) {
name=s1[0];
}
else if (x2) {
name=s1[1];
}
else if (x3) {
name=s1[2];
}
}
public static void main(String[] args) {
demo.hello();
} }
Aucun commentaire:
Enregistrer un commentaire