How do you pass an Array as a Parameter?
Hi, right now I'm writing a code that needs to pass an Array "numbers" that contains a text file from my driver into my constructor. For example, for primitives it is easy:
public Stats (int a)
or even ArrayLists:
public Stats (ArrayList<Integer> a)
How would you pass an Array this way? Thank you.
Re: How do you pass an Array as a Parameter?
Passing anything works exactly the same regardless of the data type. The only time you'll run into a difference is between primitives and objects (primitives pass by value and objects pass by reference). I believe arrays are actually objects, so they will be passed by reference too (even if they are arrays of primitives).