I need some help getting the if statement to verify that the string Array index and a string comparison are equal.
if((!dclineArr[i].equals("thousand")) || (!dclineArr[i].equals("hundred")))
i have also tired
if((dclineArr[i] != "thousand") || (dclineArr[i] != "hundred"))
everything that goes threw this comparison ends up being true
thank you for any help.
NOT OR NOT is always true – you need an AND instead of an OR (||)
Your if() checks, if
dclineArr[i]is not “thousand”. If it is “thousand”, it checks if it’s not “hundred”. It cant be both at the same time, so it results in true.