比较两个字符数组是否相等

  • Post author:
  • Post category:其他


import java.util.Arrays;

public class Kong {


public static void main(String[] args) {

int[] arr = { ‘a’,99, 93, 92, 97, ‘b’ };

int[] arr2 = {97, ‘c’, 93, 92, 97, ‘b’ };

System.out.println(“arr与arr2是否相等:” + Arrays.equals(arr, arr2));//输出true

}//当每一个字符的顺序相等即true

}

转载于:https://www.cnblogs.com/Lovemeifyoudare/p/10304452.html