时钟模拟:
[mw_shl_code=java,true]new Thread() {
public void run() {
while (true) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
System.out.println(sdf.format(new Date()));
}
}
}.run();[/mw_shl_code]
|
|