在代码里面写什么才能让输出的内容换行

来源:3-3 Java中的赋值运算符

冬马面具

2016-07-06 16:17


public class ppp {

public static void main(String[] args){

    int one=10;

    int two=20;

    int three=0;

    three=one+two;

    System.out.print("three=one+two==>"+three);

    three+=one;

    System.out.println("three +=one==>"+three);

}

}

输出内容是

three=one+two==>30three +=one==>40

我希望他输出

three=one+two==>30

three +=one==>40

写回答 关注

1回答

  • 慕先生0725014
    2016-07-06 16:22:29
    已采纳

    应该是把print改为println吧

    冬马面具

    恩恩 是的 后面全用println就都换行了

    2016-07-06 16:23:52

    共 1 条回复 >

Java入门第一季(IDEA工具)升级版

0基础萌新入门第一课,从Java环境搭建、工具使用、基础语法开始

1166786 学习 · 17593 问题

查看课程

相似问题