import java.io.*;
import java.util.*;
class Read
{
public static void main(String args[])
{
try {
Scanner scan = new Scanner(new java.io.File("textfile.txt"));
} catch (FileNotFoundException e){
}
while(scan.hasNext()){
String line = scan.nextLine();
String[] elements = line.split(",");
}
}
}
为什么我会得到
error: cannot find symbol
while(scan.hasNext()){
^
symbol: variable scan
?