第一个参数是按值传递,bumpMe++;对xx没有影响

解决方案 »

  1.   

    In java, if the primitive data type as a function parameters, it will act as the type "by value"; otherwise, if the object as a function parameters, it will act as the type "by reference".
    Because the parameter "bumpMe" is a primitive data type, but not the parameter "value".
      

  2.   

    void modifyIt(int[] value){
    参数是按引用传递,会改变原始变量
      

  3.   

    在JAVA中数组实际上是一个对象,所以传递数组时会将一个引用传递进去,对它的元素的修改会直接修改原始数据,对简单类型(int等)则按值传递,所以不会影响原始数据。