Created
April 4, 2022 18:36
-
-
Save rubykv/c3903b95aa570108f6ebc618606098ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws InterruptedException, ExecutionException { | |
ExecutorService executor = Executors.newSingleThreadExecutor(); | |
Future<Integer> cf = executor.submit(() -> { | |
return 1; | |
}); | |
System.out.print("Result " + (cf.get() + 2)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment