Estou com dificuldade para colocar esse código em java,já fiz no visualg mas não consigo em java.
É colocar em ordem crescente.
Alguém pode dar uma força?
import javax.swing.JOptionPane;
public class ordenar {
/**
* @param args
*/
public static void main(String[] args) {
int num[] = new int[4];
int tmp=0;
for(int i=0;i<num.length;i++){
num[i] = Integer.parseInt(JOptionPane.showInputDialog("Número: "));
}
for(int i=0;i<num.length;i++){
for(int j=0;j<num.length;j++){
if(num[i]<num[j]){
tmp=num[i];
num[i]=num[j];
num[j]=tmp;
}
JOptionPane.showMessageDialog(null, "A ordem é "+ num[j]);
}
}
}
}