int[] cards = new int[2]; void_fork(() -> { cards[0] = 11; }); cards[1] = 10; int total = cards[0] + cards[1]; System.out.println(cards[0] + cards[1]);
int[] cards = new int[1]; Future<Void> future = void_fork(() -> { cards[0] += 11; }); cards[0] += 10; join(future); int total = cards[0]; System.out.println(total);
int[] cards = new int[1]; void_fork(() -> { cards[0] += 11; }); cards[0] += 10; int total = cards[0]; System.out.println(total);
int[] cards = new int[2]; Future<Void> cardAFuture = void_fork(() -> { cards[0] = 11; }); cards[1] = 10; join(cardAFuture); int total = cards[0] + cards[1]; System.out.println(total);
Future<Integer> cardAFuture = fork(() -> { return 11; }); int cardB = 10; int cardA = join(cardAFuture); int total = cardA + cardB; System.out.println(total);