So for example my array print method returns {15,24,32,40,6} i need my reverse array method to print {6,40,32,24,15}
SO far I have this when I run my the program it prints {6,40,32,1,0} I cant figure out why its not printing 24 and 15 the last 2 numbers in my array.
public static void reverseArray(int [] data)
{
for(int i = 0; i < data.length / 2; i++)
{
data[i] = data[data.length - i - 1];
data[data.length - i - 1] = i;
}
}
}
as for my fill array method will create an array , and then fill them with random integers between 0 and 42 in my case but I cant use math.random it has to be a method using
Random rng = new Random();
int num = rng.nextInt();
here is what I have so far any help would be greatly appricated
thank you
Edited by yeeesh, 21 September 2011 - 12:19 PM.


Sign In
Create Account

Back to top









