把 while((c=fis.read()!=-1)
改为while((c=fis.read())!=-1)

解决方案 »

  1.   

    加括号就可以了否则 c 是 int , fis.read()!=-1  是 boolean, 赋值类型不匹配.
      

  2.   

    谢谢,
    现在还有个问题,我想把file1中的内容复制到file2里,但不覆盖file2中的原来的内容,即接着原来file2的内容继续copy,这个如何实现?
      

  3.   

    好像FileOutputStream fos=new FileOutputStream(outFile, true)就可以了
    boolean指示是否采用append即追加模式
      

  4.   

    搞定,不过你说的还有点问题,第一个参数应该为文件名,不是outFile