Integer类 没有不带参数的构造方法

解决方案 »

  1.   

    构造子索引 
    Integer(int) 
    构造一个新分配的 Integer 对象,它表示原始 int 型参数。 
    Integer(String) 
    构造一个新分配的 Integer 对象,它代表字符串所表示的值。 //要么传整数,要么传字符串,没有空的构造函数!
      

  2.   

    如果只是想保存整数,用int就可以,但是要想对整数做各种处理,用Integer,这样就可以利用Integer类的各种方法
      

  3.   

    要实例化的Integer(int value) 
     Constructs a newly allocated Integer object that represents the primitive int argument.
     
    Integer(String s) 
     Constructs a newly allocated Integer object that represents the value represented by the string 
      

  4.   

    因为Integer这个类没有一个无参的构造方法, 当然这种写法就不对了,    Integer是int的一个包装类!
      

  5.   

    Integer类 没有不带参数的构造方法