Everything works except it's not giving me what I want. Where it says 'list.add(ln)', all it does is give me a boolean that says true.
Is there any way to store what I wrote from the keyboard into the array then print it out?
ArrayList<Integer> list = new ArrayList<Integer>();
ln = 1; // prime the loop
while(ln != 0) { // begin while ln doesnt equal to zero
System.out.println("\nFor list[" + n + "], enter a number.");
ln = console.readInt();
if (ln != 0){ // begin if the input from keyboard does not equal to zero
System.out.println("Array " + list.add(ln));
n++; // update array size
} // end if the input from keyboard does not equal to zero
else
System.out.println();
} // end while ln doesnt equal to zero
ArrayList#add(..)do? Go through the javadoc.javadoc. Use it when you don't know what JDK methods do.