2
我有以下代碼:錯誤:無法找到符號BufferReader
import.java.io.*;
public class BasheminParkingLot
{
public static void main(String[]args)throws Exception
{
Stack parkinglot = new Stack();
Stack alley= new Stack();
File f = new File("bashemin.in");
FileInputStream finstream = new FileInputStream(f);
InputStreamReader finreader = new InputStreamReader(finstream);
BufferReader finput = new BufferReader(finreader);
String line = finput.readLine();
String plate = "";
System.out.println();
System.out.println("The Bashemin Status");
System.out.println();
while(line!=null)
{
if(line.charAt(0)=='a')
{
plate = line.substring(1);
System.out.println ("car" + plate + " arrived and parked");
parkinglot.Push(plate);
}
}
}
}
,並正在錯誤:
BasheminParkingLot.java:13:錯誤:無法找到符號 BufferReader finput =新BufferReader (finreader); ^
我想知道是否有人可以幫助我調試?謝謝!
請接受的答案,如果它爲你工作。接受和投票將激勵人們回答你的問題。 –