How do I invert the values of a vector? Example:
1 2 3
turn 3 2 1
I'm currently trying to make a method of type ..
public static int [] vetorInvertido(int [] vet){
int [] vetInvert = new int[vet.length];
for(int i=vet.length-1;i>=0;i--){
for(int j=0; j<=vetInvert.length; j++){
vetInvert[j] = vet[i];
}
}
return vetInvert;
}