我还没有完成这个,但如果我已经有错误没有进展。这里是我的代码..2错误:表达式的非法开始[Java]
public static void main(String[] args)
{
Scanner inputDevice = new Scanner(System.in);
System.out.print("Please enter the name of student ==> ");
studentName = inputDevice.nextInt();
inputDevice.nextLine();
System.out.printIn("Enter the mark for student "+ studentName " out of 65 ==> ");
studentMark = inputDevice.nextInt();
inputDevice.nextLine();
}
1号错误: ')' 预期
System.out.printIn("Enter the mark for student "+ studentName " out of 65 ==> ");
第二个错误:表达非法启动
System.out.printIn("Enter the mark for student "+ studentName " out of 65 ==> ");
我非常新的哈哈。我不明白为什么我的第二打印是给我一个错误
'studentName'应该是'字符串studentName','studentMark'应该是'INT studentMark',不是吗?此外,您永远不会将'nextLine()'的返回值赋值给任何东西... – domsson
哇,7行中有5行有错误或不需要。我给你写了一份所有问题的清单,以便你能够理解和解决它们,更重要的是,在未来阻止这些问题。然而,下一次请给自己一杯咖啡,仔细阅读你的代码(以及错误信息),以便在这里询问之前自己发现一些这些问题。 – domsson