Java, Checking to see if two char arrays are equal

后端 未结 2 1140
无人共我
无人共我 2020-12-11 13:41

I have two character arrays in Java:

orig_array and mix_array. I need to check if they are not equal.

Here is what I have so far:<

2条回答
  •  离开以前
    2020-12-11 14:16

    The while loop's block is only executed when the two arrays are not equal, so starting that block with the same equality check makes no sense. In other words, the line:

    if (Arrays.equals(mix_team, orig_team))
    

    ...will always be false.

提交回复
热议问题