Type conversion of int and string, java

前端 未结 5 588
借酒劲吻你
借酒劲吻你 2021-01-02 00:23

last exam we had the exercise to determine the output of the following code:

System.out.println(2 + 3 + \">=\" + 1 + 1);

My answer was <

5条回答
  •  鱼传尺愫
    2021-01-02 00:48

    It is evaluated from left to right. You concatenate"1" to "5 >=" and finally "1" to "5 >= 1".

提交回复
热议问题