Bonjour,
j'ai voulu afficher l'heure(heur:minute:seconde) sur ma console, mais rien ne s'affiche!!, si vous pouvez me dire pourquoi, merci
import
java.sql.Date;
import
java.util.Calendar;
public
class Heure {
static
String
heur;Calendar
cal;
public
Heure(){
Thread t=
new Thread();t.start();
}
public
void run(){
for(;;){
this
.
cal =Calendar. getInstance ();
heur =
this.
cal.get(Calendar.
HOUR_OF_DAY)+
":"+
this.
cal.get(Calendar.
MINUTE)+
":"+
this.
cal.get(Calendar.
SECOND);System.
out.println(
heur);}
}
public
static
void main(String [] arg){
new Heure();
}
}