Pessoal, sou novo aqui e precisava de um código que ordenasse na mesa tela os vetores em ordem normal e inversa, tentei com esse código, mas não deu certo
int i, j, aux, x;
String inputText;
int[] vetor = {10, 8, 7, 5, 2, 3};
//int vetor = new int[5];
public static void main(String[] args) {
//System.out.println("ditite um vetor teste");
//vetor[x] = inputText.nextLine();
for(int i=0;i < vetor.length; i++){
System.out.println("vetor pos +1" + (i+1) + " º");
/*for (int j=0;j < vetor.length; ++j);{
aux = vetor[j];
vetor[x]
}*/
for (int j = (j + 1); j < vetor.length; j++) { //cria o vetor
if (vetor[x] > vetor[y]) {
aux = vetor[x];
vetor[x] = vetor[y];
vetor[y] = aux;
System.out.println("foi digitado posicao " + x);
}
}
}
}
}