Glad you got it working.
Type: Posts; User: Norm
Glad you got it working.
Do you mean that the program is executing an endless loop?
Add some println statements to find out where it is looping and what the values of the variables are that would keep it from exiting the...
The code you posted did NOT use a value returned by a method to define the size of the array.
To get a value from the method, the code would be:
evenCount = read(array, evenCount);
What did...
Here's an example of how to set an array size using a value returned by a method:
int size1 = kybd.nextInt();
int[] array = new int[size1];
What array is being indexed at line 79? The error message says that the array is empty because it does not have a first element at index 0.
Add a println to print out the .length of all arrays...
Please post the full text of the error message. It shows where the exception happened and the value of the index.
Remember that array indexes range from 0 to the array length-1