+ 2
Hello everybody, could you help me for fix the problem.
I want to make : if insert a text and if the text have a same with the if steatmen and can be output "oke" for example.thank you everybody https://code.sololearn.com/caZT46mjD59V/?ref=app
2 ответов
+ 7
if(b[i].equals(c[0])) {
System.out.println("oke");
}
Use the .equals() method of the String class when comparing Strings instead of ==.
Arrays are zero based, so an array with 1 element such as c will use 0 as its index.
+ 3
@Celvine, it's a good answer from @ChaoticDawg, I recommend it for best answer : )