I have a method that will check if the debt equals zero ( divida == "0"
). If it returns true
, otherwise it returns false
.
Code:
for(String divida : dividas){
return divida == "0";
System.out.println(divida+"\n"+b);
}
return false;
It only returns false
, because the first element is non-zero, but the second is equal, and remains false
.
What do I do?