請問老師我哪里出錯了
public class HelloWorld{
? ? public static void main(String[] args) {
String imooc="hobby";
System.out.printIn("變量imooc的內(nèi)容是: "+imooc);
imooc="hobby";
System.out.println("重新賦值后的變量imooc的內(nèi)容是:"+hobby);
}
}
public class HelloWorld{
? ? public static void main(String[] args) {
String imooc="hobby";
System.out.printIn("變量imooc的內(nèi)容是: "+imooc);
imooc="hobby";
System.out.println("重新賦值后的變量imooc的內(nèi)容是:"+hobby);
}
}
2019-01-03
舉報
2019-01-03
首先你把第4行的System.out.printIn中的println(注意這里是L而不是I),你打錯了字母I。其次,在6行,應(yīng)該是System.out.println("重新賦值后的變量imooc的內(nèi)容是:"+imooc);因為在這里你想表達的是使用字符imooc,imooc是變量名,你想要使用它的值,但是你應(yīng)該用變量名imooc來使用它。