【发布时间】:2014-12-29 01:47:14
【问题描述】:
我想知道我该怎么做。
有人告诉我使用 kb.nextLine() 而不是 kb.next() ,但这只会导致我在运行程序时跳过输入。
String address;
student.setAddress(address = kb.nextLine());
然后我被告知这样做来修复它:
student.SetAddress(String address = kb.nextLine());
但我得到一个错误:
String cannot be resolved into a variable" "Syntax error on token "address"
【问题讨论】:
-
你能展示更多你的代码吗?您发布的第一行应该可以,但是没有上下文,很难说问题出在哪里。