Trouble passing array in parameters
Code Java:
import java.util.Scanner;
public class Popcreasetwo{
public static void main(String []args) {
Handlethat theOne=new Handlethat();
Scanner in=new Scanner(System.in);
System.out.println("Enter the data. ");
int[] ary1 = new int[1000];
int[] ary2 = new int[1000];
for(int y=0; y < 50; y++){
ary1[y]=in.nextInt();
ary2[y]=in.nextInt();
}
theOne.theMethod(ary1,ary2);
theOne.thePrintMethod(ary1, ary2);
}//end of main method
}// end of popcrease
class Handlethat{
public void theMethod(int [], int[]){
}//end of the method
public void thePrintMethod(int [], int[] ){
}
}// end of class handlethat
Re: Trouble passing array in parameters
Hello AngryCrow,
Before getting to the problem of this code, there are some posting good-practices you will want to consider:
1. If you are going to post code put it between the [CODE ][/CODE] tags (minus the space in [CODE ]). As this will help to see how the code is formatted and possible problems.
2. Include an actual question in your post along with any errors you are receiving. Doing so will increase your chances of getting a concise answer.
3. Include which IDE you are using just in case.
Ok, that being said, I can tell you there will be an issue with both your theMethod() and thePrintMethod() methods as you have only declared a variable type in the parameters but no variable name. Other than that things look fine. Hope this helped.
Re: Trouble passing array in parameters
I have added highlight tags for you. We like to use these instead of code tags.
Also, please make sure you post in the correct forum.
Your thread is about Arrays, so it goes in the Collections & Generics forum.
Another big mistake.. no description of your problem within your thread!
Give us as much information as possible.