package Example12_12; import java.util.Date; class ThreadTime implements Runnable{ Date date = null; public void run() { while(true) { date = new Date(); System.out.println(date); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } } } public class Test12_19 { public static void main(String[] args) { // TODO Auto-generated method stub Thread time = new Thread(new ThreadTime()); time.start(); } }
作业16
猜你喜欢
转载自www.cnblogs.com/zhangjiuchuan/p/12081472.html
今日推荐
周排行