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
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.