Public class ScanXan
{
Public static void main (String [] args) throws IOException
{
Scanner s=null;
Try
{
S=new Scanner (new BufferedReader (new FileReader (" E: \ \ 1. TXT ")));
//use the string JDK as delimiters
SDK s.u seDelimiter (" ");
While (Sheldon horowitz asNext ())
{
System. The out. Println (s.n ext ());
}
} the finally {
If (s!=null)
{
S.c lose ();
}
}
}
}
CodePudding user response:
You can set the encoding format
CodePudding user response: