【发布时间】:2017-04-25 18:19:42
【问题描述】:
为什么我不能在这里使用int?
public void submitOrder(View view) {
int numeroCafe = "5";
}
【问题讨论】:
-
您正在声明一个 int... 并为其分配一个 string。它永远不会起作用。
-
赋值不带双引号:
int numeroCafe = 5; -
您是否阅读了错误信息?这很清楚。
incompatible types: String cannot be converted to int -
你真的需要学习编程的基础知识。无论您选择哪种语言。
-
欣赏 Rotwang :)!!!