F
francan00
I currently have two String objects I check to find out if they are
the same value:
String str1 = "red";
String str2 = "yellow";
if (str1.equals(str2)){
System.out.println("Equal");
}
else{
System.out.println("Not equal");
}
Now I need to check 10 objects. How would I check 10 objects to find
out if any of them have the same value?
Please advise.
the same value:
String str1 = "red";
String str2 = "yellow";
if (str1.equals(str2)){
System.out.println("Equal");
}
else{
System.out.println("Not equal");
}
Now I need to check 10 objects. How would I check 10 objects to find
out if any of them have the same value?
Please advise.