Solved

Creating a method that accepts two integer arrays as parameters

Posted on 2006-11-19
9
191 Views
Last Modified: 2010-03-31
Can I set up a method to do this? What would it look like?
0
Comment
Question by:msheppard74
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
9 Comments
 
LVL 1

Expert Comment

by:bnblazer
ID: 17976403
public foo(int[] a, int[] b) {

// do something here

}
0
 
LVL 1

Accepted Solution

by:
bnblazer earned 400 total points
ID: 17976411
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
 

Author Comment

by:msheppard74
ID: 17976432
What if I wanted to switch the elements of the two arrays? Usually, one array is longer than the other.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Expert Comment

by:suprapto45
ID: 17976483
>>"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
 
LVL 1

Expert Comment

by:bnblazer
ID: 17976495
If you could give an actual problem statement or some code we could be of much more help.
0
 

Author Comment

by:msheppard74
ID: 17976525
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
 

Author Comment

by:msheppard74
ID: 17976529
I'm merely wanting to switch the contents of the arrays.
0
 
LVL 16

Assisted Solution

by:suprapto45
suprapto45 earned 100 total points
ID: 17976535
>>"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
 
LVL 16

Expert Comment

by:suprapto45
ID: 17976577
;).

Glad I could help.

David
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question