Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Creating a method that accepts two integer arrays as parameters

Posted on 2006-11-19
9
Medium Priority
?
199 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 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

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!

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

618 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