标签:问题 比较 system ring array string int equal str
问题描述:比较两数组是否相等
Demo_1:
import java.util.Arrays; public class TestArray { public static void main(String[] args){ int[] a = {3,2,4,5,1,2,7,8,6,4,58,69,48,69}; int[] b = {3,2,4,5,1,2,7,8,6,4,58,69,48,69}; Arrays.sort(a); Arrays.sort(b); String s1 = Arrays.toString(a); String s2 = Arrays.toString(b); System.out.println(Arrays.equals(a,b)); //true System.out.println(s1.equals(s2)); //true } }
标签:问题 比较 system ring array string int equal str
原文地址:http://www.cnblogs.com/bosongokay/p/7620166.html