到底哪里錯了?
public class HelloWorld{
? ? public static void main(String[] args) {
? ? String city = "茂名";
? ? ? ? System.out.println("我的家鄉(xiāng)在:"+city);
}
}
public class HelloWorld{
? ? public static void main(String[] args) {
? ? String city = "茂名";
? ? ? ? System.out.println("我的家鄉(xiāng)在:"+city);
}
}
2017-03-08
舉報
2017-07-17
沒有錯誤,只是網(wǎng)站的解析可能有問題
2017-03-16
public static void 中的public 表示該方法可以在類外部訪問,static 表示該方法可以通過類名直接訪問,不需要通過對象。void表示該方法沒有返回值
2017-03-08
家鄉(xiāng)后面的冒號你試試中文輸入法和英文輸出法切換一下
2017-03-08
我粘貼過去測試了沒問題