Creating a method that accepts two integer arrays as parameters

Can I set up a method to do this? What would it look like?
msheppard74Asked:
Who is Participating?
 
bnblazerConnect With a Mentor Commented:
actually is would be like this (sorry typed too fast)

public void foo(int[] a, int[] b) {

// do something and assume no return value

}
0
 
bnblazerCommented:
public foo(int[] a, int[] b) {

// do something here

}
0
 
msheppard74Author Commented:
What if I wanted to switch the elements of the two arrays? Usually, one array is longer than the other.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
suprapto45Commented:
>>"What if I wanted to switch the elements of the two arrays? Usually, one array is longer than the other."
Can you explain more?
0
 
bnblazerCommented:
If you could give an actual problem statement or some code we could be of much more help.
0
 
msheppard74Author Commented:
it's a hypothetical at this point. I don't have any code yet. I'm just looking for generic code or pseudo code to get me going.
0
 
msheppard74Author Commented:
I'm merely wanting to switch the contents of the arrays.
0
 
suprapto45Connect With a Mentor Commented:
>>"switch the contents of the arrays."
You can loop the first array and compare it with second array and do the necessary logics that you want.
0
 
suprapto45Commented:
;).

Glad I could help.

David
0
All Courses

From novice to tech pro — start learning today.