Java, how to compare Strings with String Arrays

后端 未结 6 1951
耶瑟儿~
耶瑟儿~ 2020-12-15 06:07

I have been searching here for some time but haven\'t been able to find the answer to it.

I am basically required to use an array for this assignment from college. A

6条回答
  •  旧巷少年郎
    2020-12-15 07:08

    Right now you seem to be saying 'does this array of strings equal this string', which of course it never would.

    Perhaps you should think about iterating through your array of strings with a loop, and checking each to see if they are equals() with the inputted string?

    ...or do I misunderstand your question?

提交回复
热议问题