public class HelloWorld{ public static void main(String[] args) { String hobby="hong"; System.out.println("+hobby"); hobby="i love hong"; System.out.println("+hobby"); } } 谁能告诉我 错哪了吗?实在找不着
你这好是要干嘛,设置了变量又不用。
你是不是要这样:
String hobby="hong"; System.out.println("+" + hobby); hobby="i love hong"; System.out.println("+" +hobby);
望采纳!
public class HelloWorld{
public static void main(String[] args) {
String hobby="hong";
System.out.println("+hobby");
hobby="i love hong";
System.out.println("+hobby");
}
}
或者大神以这个为例,写一下正确的!!!!