Please help with passing an array to a new class
I have no knowledge of passing to and from a class to another class so if anyone can please help me.
I have to enter integers in a Java class with a GUI and then sort the integers in a different class in the same package. So far I have been able to sort it in the same class but need to only sort it in a different class and then pass the sorted array back to be displayed in the main class.
This is my working code so far:
int array1=new int;
array1 = Integer.parseInt(jTextField1.getText());
array1 = Integer.parseInt(jTextField2.getText());
array1 = Integer.parseInt(jTextField3.getText());
Re: Please help with passing an array to a new class
Create a different class, create a method that sorts the array, then pass the array to said class.
This thread has been cross posted here:
Although cross posting is allowed,
for everyone's benefit, please read:
Java Programming Forums Cross Posting Rules
The Problems With Cross Posting