以下代码有错误
"去"没有标识符
但我想当我宣布"去"作为String类型变量,它为变量" go"?
提供了一个标识符显然我已经把它搞砸了,因为我是Java新手(并且编码一般),所以我想知道如何识别变量" go"并解决我面临的问题。提前致谢。
以下是代码:
public class ATM {
public static void main(String[] args){
String ATM;
ATM myATM = new ATM();
myATM.go();
}
public class go {
String go;
go = "Welcome to online ATM banking";
go = "How much do you wan in your account?";
go = "Enter your number";
System.outprintln(go);
}
}
答案 0 :(得分:1)
有一些小问题:
这是完整的更新类编译。
public class ATM {
public static void main(String[] args) {
String ATM;
ATM myATM = new ATM();
myATM.go();
}
public void go() {
String go;
go = "Welcome to online ATM banking";
go = "How much do you wan in your account?";
go = "Enter your number";
System.out.println(go);
}
}