当前位置: 技术问答>java相关
怎么用简洁的方法找出两个数组中不同的元素?
来源: 互联网 发布时间:2015-05-10
本文导语: 怎么用简洁的方法找出两个数组中不同的元素? 如: String [] array1=new String[]{"1","2","3","5"}; String [] array2=new String[]{"2","3","4","6","7"}; 那么要返回数组元素中应是:{"1","4","5","6","7"}; 谢谢! | ...
怎么用简洁的方法找出两个数组中不同的元素?
如:
String [] array1=new String[]{"1","2","3","5"};
String [] array2=new String[]{"2","3","4","6","7"};
那么要返回数组元素中应是:{"1","4","5","6","7"};
谢谢!
如:
String [] array1=new String[]{"1","2","3","5"};
String [] array2=new String[]{"2","3","4","6","7"};
那么要返回数组元素中应是:{"1","4","5","6","7"};
谢谢!
|
String[] array1=new String[]{"1","2","3","5"};
String[] array2=new String[]{"2","3","4","6","7"};
String[] arrayMax = array1.length>array2.length?array1:array2;
String[] arrayMin = array1.length
String[] array2=new String[]{"2","3","4","6","7"};
String[] arrayMax = array1.length>array2.length?array1:array2;
String[] arrayMin = array1.length