DS
Size: a a a
DS
Y
DS
Y
Y
DS
DS
DS
Y
Callable<String> callable = () -> {
// Perform some computation
new Thread(s1::increment).start();
new Thread(s2::increment).start();
System.out.println("Result: " + s1.getValue());
System.out.println("Result: " + s2.getValue());
Thread.sleep(1000);
return "Hello from Callable";
};
DS
Y
Y
DS
Y
Y
Task is still not done...
0
1
Result: 1
Result: 2
Task is still not done...
Task is still not done...
Task is still not done...
Task is still not done...
Task was cancelled
Y
Y
Y
DS
DS