Arrays in reverse order

Im so close I can smell it. Please help me arrange any numbers in reverse order (Arrays) from user input. What is wrong?

class Practical73

{

public static void main (String[] args)

{

//create and initialise an array of 5 integers

int numbers[] = new int [5];

// loop and fill each element

for (int x = 0; x < numbers.length; x++)

{

System.out.println("Enter a number: ");

numbers[x] = EasyIn.getInt();

}

//loop and output each element

for (int x = 0; x < numbers.length; x++)

{

System.out.println((x + 1)+ ": " + numbers [x]);

}

System.out.println("\nYour numbers in reverse order are:\n");

for (int x = numbers -1; x >= 0; x--)

{

System.out.println(numbers[x]);

}

}

}

thanks

[842 byte] By [Killervee3a] at [2007-10-2 5:46:31]
# 1

You should say exactly what is wrong - compile error (I suspect), output should be but is actually, etc.

A quick look makes me think:

for (int x = numbers -1; x >= 0; x--)

should be

for (int x = numbers.length -1; x >= 0; x--)

jbisha at 2007-7-16 1:56:18 > top of Java-index,Java Essentials,New To Java...
# 2
Thankyou jbish for the help, it did work with your suggestion.
Killervee3a at 2007-7-16 1:56:18 > top of Java-index,Java Essentials,New To Java...
# 3
> Thankyou jbish for the help, it did work with your> suggestion.Glad I could help.
jbisha at 2007-7-16 1:56:18 > top of Java-index,Java Essentials,New To Java...