I would like to print my values in my array. I am filling my values with a string tokenizer that I leave up to the user to fill.
When I use this method I get extra values since its initialized to 10.
int[] anArray = new int[10];
for (int i = 0; i < anArray.length; i++)
{
System.out.println("The values in the array " + anArray[i]);
}
When I use this method it gives me a null error. If I don't initialize it complains that I haven't intialized it.
int[] array = null;
for (int i = 0; i < anArray.length; i++)
{
System.out.println("The values in the array " + anArray[i]);
}
What can I do to print the values filled values in array?