java之併發&線程(三)

JavaSE5提供了一個方便操作線程的方式。 下面是一個run方法。 在使用時可以用executor。代替了你調用start。 execute(Runnable)方法runnable 必須不爲空。Runnable爲空是nullpointexception。 當無法執行runnable時rejectedExecutionException。 Tips:executor正在關閉並且不想接受新的任務時,
相關文章
相關標籤/搜索