哪里錯了
問題描述:一直報錯public class sunshuo{
? public static void main (String[]args){
?? System.out.println("suns");
? String? = wo;
???? wo = 河南;
? System.out.println("我的家鄉(xiāng)在"+wo);
}
}
問題描述:一直報錯public class sunshuo{
? public static void main (String[]args){
?? System.out.println("suns");
? String? = wo;
???? wo = 河南;
? System.out.println("我的家鄉(xiāng)在"+wo);
}
}
2021-11-13
舉報
2021-11-13
? String? = wo;
???? wo = 河南;? ?
用法錯誤,String是引用變量類型,字符串,定義方法和賦值方法都有問題。
正確方法:String wo="河南";
或者:String wo;
? ? ? ? ? wo="河南";