return  x1==x2?(x2==x3?(x3==x4?(x4==x5?1:0):0):0):0 ;1:  全相等
0:  有不相等的

解决方案 »

  1.   

    Using Set. 
    add five times. then check the set size equals to 5 or less.
      

  2.   

    回复人: 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:  有不相等的
      
     
      

  3.   

    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("有相等数据");
            }    }
      

  4.   

    用一个HashMap把5个数逐个加进去,
    if(myHashMap.containsKey(myObjectData))
       //有相同的,相等。
    else 
       myHashMap.put(myObjectData,"");