....

解决方案 »

  1.   

    实践出真知.
    顺便好奇一下,谁说的基本类型可以new啊喵~~``
      

  2.   

    "new"是要调用类的构造方法的,基本类型有吗?
      

  3.   

    基本类型是不可以的
    int int1  = new int();  这个肯定是错误的但是这个可以哦:封装类型是可以的哦!Integer int2 = new Integer();
      

  4.   

     Float  f  = new Float(0);
     Integer n = new Integer(0);这样都是可以哦。
      

  5.   

    要加参数,
    Integer de = new Integer(34);
    这样就可以
      

  6.   

    那是当然了,Integer 没有提供无参构造。类中没有任何构造的情况下有个默认的无参构造,但是类中有了一个其他的构造,
    默认的无参构造就没有了。需要的话就必须显式声明。
      

  7.   

    package squall;public class Test1
    {
    public static void main(String[] args)
    {
    int i  = new Integer(5);
    System.out.println(i);
    }
    }JDK1.6这样是可以过的,1.4好像不可以,1.5忘记了
      

  8.   

    誰告訴你基本類型可以new的?
    、、、、
      

  9.   

    他妈有病!!!primitive可以new嘛????
      

  10.   

    貌似没见过new int 的 
      

  11.   

    不可以。
    但是在jdk1.5之后可以这样用
    int i = new Integer(1);
    因为封装类型可以自动装箱自动拆箱:)
      

  12.   

    首先明确一点,基本类型不是类。
    int 是基本类型
    integer 是基本类型封装类。
    类可以new()
    基本类型不可以new()。
    有些教材说基本类型就是类是错误的。