Java线程和异常处理

时间:2018-07-09 10:14:17

标签: java multithreading exception-handling

我有以下方法:

var article2 = article2.split(/(?=[A-Z][a-z])/); 

我希望主类等待线程完成所有记录的处理,然后返回// Main Class: processRecords(ArrayList<String> records) { Boolean isSuccess = false; ProcessRecordThread thread = new ProcessRecordThread(records); new Thread(thread).start(); return isSuccess; } // Thread class: run() { for (String record : records) { try { process(record); } catch (Exception e) { isSuccess = false; } } } 变量并继续执行主类。

0 个答案:

没有答案