Frustrated trying to Read File
Hi All,
I have this program below but it won't compile without errors.
The errors reported at this time are noted below the program.
Help is appreciated.
bH
import java.io.*;
public class ReadFile {
String strArry[] = new String[15];
public static void main (String args[])throws Exception{
//System.out.println("here");
ReadFile rFile = new ReadFile();
rFile.test();
} //main
public void test(){
try{
FileInputStream fis = new
FileInputStream("NameAgeWeightFile.txt");
BufferedReader bor = new BufferedReader(new
InputStreamReader(fis));
for(int i=0; i<15; i++){
strArry[i] = bor.readLine();
} //end of for
bor.close();
} //end of try
catch (Exception e) {
System.out.println("error getting data");
} //end of catch
for(int ic=0; ic<15; ic++){
System.out.println (strArry[ic]);
} //end of for
} //end of test
} //end of ReadFile
error list:
ReadFile.java, Line 16 : Class BufferedReader not found in type
declaration.
BufferedReader bor = new BufferedReader (new
InputStreamReader(fis));
^
ReadFile.java, Line 16 : Class BufferedReader not found in type
declaration.
BufferedReader bor = new BufferedReader (new
InputStreamReader(fis));
^
ReadFile.java, Line 19 : Class BufferedReader not found in void test().
strArry[i] = bor.readLine();
^
ReadFile.java, Line 19 : Class BufferedReader not found in void test().
strArry[i] = bor.close();
^