问答详情
源自:2-5 如何命名Java变量

Java中如何实现换行输出与一条输出语句多对象输出?

public class HelloWorld{

    public static void main(String[] args) {


String hobby = "我爱慕课网";

String address = "www.imooc.com";

//System.out.println(hobby);

//System.out.println(address);

System.out.println(+hobby\n+address);

}

}


提问者:An_chor 2018-09-16 00:00

个回答

  • Zaman
    2018-09-16 00:43:11
    已采纳

    System.out.println(one1+two2);

  • 黑白间隔
    2018-09-18 11:29:41

    System.out.println(one1+"\n"+two2);