怎样判断5个数据互不相等 return x1==x2?(x2==x3?(x3==x4?(x4==x5?1:0):0):0):0 ;1: 全相等0: 有不相等的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Using Set. add five times. then check the set size equals to 5 or less. 回复人: stillfire(恒) ( ) 信誉:100 2003-05-28 16:28:00 得分:0 return x1==x2?(x2==x3?(x3==x4?(x4==x5?1:0):0):0):0 ;1: 全相等0: 有不相等的 public void test1(){ String x1 = "abc"; String x2 = "ABC"; String x3 = "Abc"; String x4 = "abc"; String x5 = "abc"; HashSet set = new HashSet(); set.add(x1); set.add(x2); set.add(x3); set.add(x4); set.add(x5); System.out.println("set.size()" + set.size()); if(set.size() == 5){ System.out.println("互不相等"); } else { System.out.println("有相等数据"); } } 用一个HashMap把5个数逐个加进去,if(myHashMap.containsKey(myObjectData)) //有相同的,相等。else myHashMap.put(myObjectData,""); java打印的对话框调了上下页边距,但打印出来后不是这个距离 怎么表示一个整数是无限大 我学了一年的j2ee了,可是发现,现在网上用得很多都是asp呀! 统计子串频率 java的应用程序的问题, 怎么样实现在JTree上的MouseListener? 小小问题,如何拷贝sql server一张相同结构的表? 谁能告诉我Java不是个烂语言? 哪里可以下载JBuilder3 Enterprise版? 怎么将输入的一个数字按倒序分别输出来 急!~ JMF RTP问题真的这么难么?
add five times. then check the set size equals to 5 or less.
return x1==x2?(x2==x3?(x3==x4?(x4==x5?1:0):0):0):0 ;1: 全相等
0: 有不相等的
String x1 = "abc";
String x2 = "ABC";
String x3 = "Abc";
String x4 = "abc";
String x5 = "abc"; HashSet set = new HashSet();
set.add(x1);
set.add(x2);
set.add(x3);
set.add(x4);
set.add(x5); System.out.println("set.size()" + set.size());
if(set.size() == 5){
System.out.println("互不相等");
} else {
System.out.println("有相等数据");
} }
if(myHashMap.containsKey(myObjectData))
//有相同的,相等。
else
myHashMap.put(myObjectData,"");