Why does a void function return a value?

前端 未结 5 2011
北海茫月
北海茫月 2021-01-27 07:54

I\'m a programming beginner and I have question regarding a return value from a function.

I´m studying Java.

I have attached code from my book that features a cl

5条回答
  •  天命终不由人
    2021-01-27 08:36

    sort(int[] a), a void function, does not return a value.

    Instead, sort() modifies the array passed to it in-place. You passed an array object to sort() and your code modified it.

提交回复
热议问题