+ 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

15th Mar 2018, 2:52 AM
Celvine Adi Putra
Celvine Adi Putra - avatar
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.
15th Mar 2018, 4:21 AM
ChaoticDawg
ChaoticDawg - avatar
+ 3
@Celvine, it's a good answer from @ChaoticDawg, I recommend it for best answer : )
15th Mar 2018, 6:10 AM
Ipang