我在读取文件时遇到了一些问题。我认为解释正在发生的事情的最好方法是向您展示代码。
File x = new File("D:\\player.txt");
try {
e = new Scanner(x);
while (e.hasNext()) {
playername = e.next();
playerlevel = e.next();
playerstrenght = e.next();
playerdefense = e.next();
playersoul = e.next();
}