請問我這個代碼錯在哪里?
public class HelloWorld{
? ? public static void main(String[] args) {
? ? String a="我愛慕課網";
? ? String b="www.xianlaiwan.cn";
? ? System.out.println(a);
? ? System.out.println(b);
}
}
public class HelloWorld{
? ? public static void main(String[] args) {
? ? String a="我愛慕課網";
? ? String b="www.xianlaiwan.cn";
? ? System.out.println(a);
? ? System.out.println(b);
}
}
2016-05-18
舉報
2016-05-18
?String a="我愛慕課網";
這一句的分號是中文輸入法的分號!
2016-05-18
String a="我愛慕課網";中“;”格式不對,檢查一下吧
2016-05-18
String a="我愛慕課網"; 這里用了個中文的分號。
2016-05-18
可能有中文符號
2016-05-18
給你在eclipse中運行了一下,應該是字符串a那一行最后的分號是中文分號的原因,所以會出錯,改成英文分號就可以了