Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Creating a method that accepts two integer arrays as parameters

Posted on 2006-11-19
9
Medium Priority
?
206 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
  • 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 1600 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 400 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

810 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