Java When outputting String and method return, why does method return output first?

后端 未结 5 1046
Happy的楠姐
Happy的楠姐 2021-01-23 06:03

In the code below, if the string \"Mult\" comes before the test1(4) method call, why does the method output before the string? And why does it bounce f

5条回答
  •  情书的邮戳
    2021-01-23 06:46

    It obvious.If a method does not have its arguments calculated it cant be completed. In your case the println method must have its arguments computed before it can be executed. So the function call to test1 method is made which completes first. Then the statement in main is executed.

提交回复
热议问题