黑马程序员技术交流社区

标题: Java编译提示非法表达式开始 [打印本页]

作者: 零点Crazy    时间: 2015-2-10 17:22
标题: Java编译提示非法表达式开始
import java.io.*;
import java.util.*;
class SequenceDemo
{
        public static void main(String[] args) throws IOException
        {
                Vector<FileInputStream> v= new Vector<FileInputStream>();
                v.add(new FileInputStream("1.txt"));
                v.add(new FileInputStream("2.txt"));
                v.add(new FileInputStream("3.txt"));
                Enumeration<FileInputStream> en=v.elements();
                SequenceInputStream sis=new SequenceInputStream(en);
                FileOutputStream fos=new FileOutputStream("4.txt");
                byte[] buf=new byte[1024];
                int len=0;
                while ((len=sis.read(buf))!=-1))//这句编译提示非法表达式开始,感觉代码没写错
                {
                        fos.write(buf,0,len);
                }
                sis.close();
                fos.close();
        }
}






欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2