Is your problem solved now?
Type: Posts; User: Norm
Is your problem solved now?
What does that mean?
Is there a variable for each person? What type is the variable? String or int or a new class you're going to create?
short[] aryLa = new short[70];
With this array definition, the values of the index can be from 0 to 69.
The element: aryLa[70] does NOT exist.
yes, that is the problem
The contents of the array can be any valid short value. The values of the indexes into the array can only be from 0 to 69.
short[] aryLa = new short[70];
What is the maximum index value you can have for the array aryLa?
What is the value of the first index used in your code?
Is that what you would expect from the code?
I would think it would print out forever or until the buffer got full or you stopped the program.
What code in the loop will stop the loop from...
for(aryOneAdder = 0; aryOneAdder < 122;){
if (aryOneAdder <121){
aryOneAdder++;
}
aryOne[aryOneAdder] = aryOne[1];
...
What is it supposed to output? Can you explain what the code is supposed to do to generate its output?
Perhaps you should post the current version of the program with an explanation of what it is...
??? The last post showed that the output was the numbers from 1 to 121
Ok. Is your problem solved now?
What is the contents of: aryOne[1] ?
You are copying it into all of the elements of the array?
If it contains 0 then your program is working as I'd expect it to.
import java.util.Arrays;
What source line is at line 21?
What import statements do you have in your program?
You need to import the package that the Arrays class is in?
To see what is in the array after your code executes use this:
System.out.println(Arrays.toString(aryOne)); // Show array's contents
Try playing computer with your program to see how how the values of the variables change.
Go thru the code line by line and record what variables are set to what values.
At the end what is the...
Magic. Or you've got a ghost changing your program.
There is important info in the error message, please copy and paste here the full text of the message.
It looks like you create the array AFTER you try to use it.
Create the array BEFORE you use...
byte[] aryOne = new byte[aryOneAdder]; // Create a new byte array with aryOneAdder elements
Your loop creates a new array every time it loops. That replaces the one that was created on the last...