printing an int value right after a String value

前端 未结 9 1427
日久生厌
日久生厌 2021-01-27 06:00

I have the following example code:

int pay = 80;
int bonus = 65;
System.out.println(pay + bonus + \" \" + bonus + pay);

could someone please ex

9条回答
  •  执笔经年
    2021-01-27 06:15

    bonus and pay are both ints, and therefore going to be combined into a single int result.

    You need to insert an empty string between them.

提交回复
热议问题