We want to connect the people who have knowledge to the people who need it, to bring together people with different perspectives so they can understand each other better, and to empower everyone to share their knowledge.
System.out.println("bat dau chay" + Calendar.getInstance()); Callable callable1 = new Callable() { @Override public String call() throws Exception { System.out.println("task 1"); return "task --1"; } }; Callable callable2 = new Callable() { @Override public String call() throws Exception { System.out.println("task 2"); return "task --2"; } }; Callable callable3 = new Callable() { @Override public String call() throws Exception { System.out.println("task 3"); return "task --3"; } }; List<Callable> callables = new ArrayList(); callables.add(callable1); callables.add(callable2); callables.add(callable3); callables.add(callable1); callables.add(callable2); callables.add(callable3); callables.add(callable1); callables.add(callable2); callables.add(callable3); ExecutorService executorService = Executors.newFixedThreadPool(5); List<Future> futures = executorService.invokeAll(callables); for (Future f : futures) { System.out.println(f.get()); } System.out.println("ket thuc" + Calendar.getInstance()); executorService.shutdown();
2.2K Point(s)
1.2K Point(s)
313 Point(s)
178 Point(s)
138 Point(s)
Input your email to receive reset password link, or if you remember your password, you can click