import java.util.*;  //这里提示错误
class f{int i;
 f(int j){
 this.i=j;   
 }
}
public class  f11{
    public static void main(String[]args){     
        f[]a=new f[5];
        f[]b=new f[5];
        a[0]=new f(0); //这里提示错误
        b[0]=new f(6);
        System.out.println(Arrays.deepEquals(a,b));
        }  
    }
那里错了?如何改写

解决方案 »

  1.   

    import java.util.*;  //这里提示错误
    class f
    {
     int i;

          f(int j)
      {
            j=this.i;   
               }
    }
    public class  f11{
        public static void main(String[]args){     
            f[] a=new f[5];
            f[] b=new f[5];
            a[0]=new f(0); //这里提示错误
            b[0]=new f(6);
            System.out.println(Arrays.equals(a,b));
            }  
        }
      

  2.   

    主要是deepEquals()方法错了,不知楼主用的是什么版本,查我的1.4.2版没有此方法!