用静态方法吧。 
long Id1 = Long.parseLong(Integer .toString(Id));

解决方案 »

  1.   

    謝,不過parseLong(為string),這樣...
      

  2.   

    你可以把int转换成String 啊,比如这样:"20"
      

  3.   

    Invalid cast from long to java.lang.String. long Id1= Long.parseLong((String)Id); 這樣也不行啊,幫幫我啊...
      

  4.   

    Incompatible type for method. Explicit cast needed to convert long to int. 
    long Id1= Long.parseLong(Integer.toString(Id));
      

  5.   

    你用在哪里啊?long Id1 = Long.parseLong(Integer .toString(Id));是可以编译通过的
    long Idl =(long)Id; 更好