为了账号安全,请及时绑定邮箱和手机立即绑定

为何这是错的呢

public class HelloWorld{

    public static void main(String[] args) {

String xf1="我爱慕课网";

String xf2="www.imooc.com";

System.out.println("xf

1");

System.out.println("xf2");

            }

}

正在回答

3 回答

把括号去掉 你那样写打印的是值为 xf1  和  xf2 的两个字符串

0 回复 有任何疑惑可以回复我~

把括号内的" " 去掉。像我下面写的那样

System.out.println(xf1);

System.out.println(xf2);


1 回复 有任何疑惑可以回复我~

你不能把变量名分开,应该写成System.out.println("xf1");

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

为何这是错的呢

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信