Hey need lots of help on arrays!
this is the exercise...
Write a Java application that creates an array of int initialised with the following numbers:
1 4 9 16 17 21 25 33 37 40
and reverses the contents of the array such that the value in the first element is the value that was at the last element and the value in the last element is the value that was in the first element. Below is an example of what the application should produce.
40 37 33 25 21 17 16 9 4 1
public class ArrayExercise1 {
public static void main (String[] args) {
int[] values = new int[10];
values[ 10 ] = 0;
thats my code at the moment, its not finished because im stuck and i really am not sure what to do! please help, i have to use int for it to work!
get back to me! thanks!