How do I get out of this Thread?

0

This code is like a chronometer that counts up to 10, the problem is that after it no longer allows me to continue entering text with System.out.println or anything, if it does not finish running the complete code, how can I exit? of the?

public class segundero {
    public static void main(String [] arg){
        //  codigo del segundero
        int segundos = 0;           
        for(segundos=0;segundos<10;segundos++){
                System.out.println(segundos);
                delaySegundo(); 
        }
    }
    private static void delaySegundo(){
        try{

            Thread.sleep(1000);

        }catch(InterruptedException e){

        }

        System.out.println("texto nuevo");
        //  Aquí termina el codigo del segundero
    }    
}
    
asked by Luis Sanches Larios 24.07.2017 в 01:48
source

0 answers