当前位置: 动力学知识库 > 问答 > 编程问答 >

Method parameters order in Java

问题描述:

Possible Duplicate:

Order of execution of parameters guarantees in Java?

If I have a Java method like:

 public void func(byte b, byte c) {...}

And I use it like this:

 a = 0;

func(a++, a);

Wich parameter is passed first? Because if i'm not wrong, if it's the left one then b = 0 and c = 1. And if it's the right one then b = 0 and c = 0?

Thank you.

网友答案:

The arguments are evaluated left to right, as specified in the JLS - section 15.7.4.

分享给朋友:
您可能感兴趣的文章:
随机阅读: