import java.io.*;
public class ReadFile 
{
public String[] a = new String[1024]; 

void ReadFile()throws Exception
{
FileReader fr = new FileReader("ming.txt");
BufferedReader br = new BufferedReader(fr);
String str;
int i = 0;
 

while ((str = br.readLine()) != null)
{


try
  {
  a[i++] = str.split("\r");//////错误的地方找到String[], 需要String


   }
   catch (ArrayIndexOutOfBoundsException e)
   {
    System.err.println(e + ": 1111111 ");
   }
   catch (NumberFormatException e)
   {
    System.err.println(e + ": 2222222 ");
   }

       }
     for(i=0;i<a.length;i++)
     System.out.println(a[i]);
}
}
主函数在别的位置,这只是一个方法,为什么会出错?
想把下面文件读到一个数组里面,每一个行为数组的一个值ming.txt
1 2 1
1 3 2
1 6 1
5 6 2
2 3 2
2 6 2