package test;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Test6 {
public static void main(String[] args) throws IOException {
FileInputStream fis=new FileInputStream("f:\\3.txt");
//文件字节流
InputStreamReader isr=new InputStreamReader(fis,"UTF-8");
String str=null;
//直接读取字符
int c=0;
while((c=isr.read())!=-1)
System.out.print((char)c);
BufferedReader br=new BufferedReader(isr);
str=br.readLine();
String arrays[] = str.split(" ");
for(int i=0;i<arrays.length;i++)
System.out.print(arrays[0]);
System.out.print(arrays[0]);
System.out.print(arrays[1]);
}
}
运行时出现这个问题怎么解决?
Exception in thread "main" java.lang.NullPointerException
at test.Test6.main(Test6.java:27)
|
|