【发布时间】:2016-04-14 14:38:48
【问题描述】:
我正在关注这个tutorial,它给了我这个代码:
"Run the module `hello.ceylon`."
shared void run() {
process.write("Enter a number (x): ");
value userX = process.readLine();
value x = parseFloat(userX);
process.write("Enter a number (y): ");
value userY = process.readLine();
value y = parseFloat(userY);
if (exists x, exists y) {
print("``x`` * ``y`` = ``x * y``");
} else {
print("You must enter numbers!");
}
}
但它给了我这个信息:
参数必须可分配给 parseFloat 的参数字符串:String?不能分配给字符串
我已经复制/粘贴了这段代码,但仍然是相同的消息。
【问题讨论】:
标签: ceylon