I think the first thing you want to do is add this site to your browsers bookmarks or favorites:
http://java.sun.com/j2se/1.5.0/docs/api/Next download BlueJ at
http://www.bluej.org/download/download.htmlIn Linux I used the command
# java -jar ./bluej-213.jar
to install BlueJ, and the command
# ln -s /usr/local/bluej/bluej /usr/bin/bluej
to make it executable,
but there are also Windows and Mac versions.
Next, Google and the javadocs are your friends. Find the name of the object you want to work with in your bookmarked Javadocs. Then type in the name of the object you are trying to work with followed by "java" and maybe "tutorial" into Google when you have a question.
Example: Google -> "integer array java".
You can save and compile the code using the BlueJ editor, and right clicking on a class gets you access to the main function.
Also, test a lot while developing; try something, see if it compiles, and when you are curious see if it runs. Take small steps and eventually you will have a large robust program.
So off to the heart of the problem; this is what I got. Next one try on your own

CODE
import java.util.*;
import java.io.*;
public class Loops {
public static void main (String[] arg){
int j = 0; // declare the array counter
Integer i = new Integer(1); // declare an Integer class to hold the value
Integer[] a = new Integer[256]; // declare the Integer array
// Prepair for reading input from the command line
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String strVar = null;
try { // catch any io errors that may crop up
while( i != -1) { // loop until user stops the proccess
// Note: an error will occur if the user tries to input more than 256 integers
System.out.print("Please Input Number(-1 to stop): "); // prompt for input
strVar = br.readLine(); // read a string from the command line
try { // catch non integers and display an error
i = Integer.parseInt( strVar ); // convert the string to an integer
} catch (Exception e) {
System.out.println("ERROR! Please Input an Integer:(");
}
if( i != -1) a[j++] = i; // if the user has not stopped the proccess, put the number in the array
//System.out.print( a[j-1] ); // use for testing.
}
} catch (IOException ioe) {
System.out.println("IO ERROR: could not read the number!");
System.exit(1);
}
for(--j; j > 0; j--) { // print out the array values in reverse order
System.out.print( " " + a[j] );
}
}
}