import java.io.*;
public class Numero {
public static void main (String args[]) throws Exception {
Numero temp = new Numero();
temp.IniciarNumero();
}
public void IniciarNumero() throws Exception {
Thread run = new Thread();
run.start();
int i = 1;
while (i < 180) {
run.sleep (1000);
i++ ;
System.out.pritln (i);
try { Runtime.getRuntime().exec("command /c cls");
} catch (IOException a) {
System.out.println("error:" +a.toString());
}
}
}
}
Note, o exemplo deveria lançar a variavel I e logo enseguida limpar e lançar novamente … fazendo uma sobreposições do numero 1, 2, 3, 4 até 179 … porém o método Runtime não funcionou de acordo… Gostaria de saber se há outro metodo para dar um Clear Screen na tela ou para fazer funcional o código apresentado. Obrigado!