In my text book there was nothing that seemed weird, to me at least, which is say that I have a class and this class has a method that takes an array on integer(or anything) then sort it with any kind of algorithm. The weird part is he just calls the method and passes the array, and the method will not return anything it is void.
.....
sort(anArray)
.....
.....
.....
public void sort(int[] array)
.....
and that will immediately update anArray to be sorted. What I have in mind is the method will return another array which is the same array but sorted so it will be
.....
arrayx = sort(anArray)
.....
.....
.....
public int[] sort(int[] array)
.....
can you please explain to me the differences.