更新时间:2023-01-11 19:54:46
使用下面的代码,扫描仪接下来仅给出一个单词,使用nextLine代替读取整行.
use below code, scanner next gives just a word use nextLine instead to read whole line..
Scanner scan = new Scanner(file);
String str1 = scan.nextLine();
if(str1.equals("!- =========== ALL OBJECTS IN CLASS: FENESTRATIONSURFACE:DETAILED ==========="))
System.out.println(str1);
scan.close();