I am trying to read my text file "inputFile.txt" but system shows the error below. Can anyone help me to solve this error? Thank you!
error: incompatible types: FileInputStream cannot be converted to Reader Yylex yy = new Yylex(fin);
//create file object
File infile = new
File("C://name//test_jflex//inputFile.txt");
int ch;
StringBuffer strContent = new StringBuffer("");
FileInputStream fin = null;
try {
fin = new FileInputStream(infile);
Yylex yy = new Yylex(fin);
Yytoken t;
while ( (t = yy.yylex()) != null )
System.out.println(t);
fin.close();
}