-
-
Save maxandersen/ce014e0e9497d4848c4ab1c503b22850 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//JAVA 21+ | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class Main { | |
static { | |
System.out.print("Hello,"); | |
try (ExecutorService executor = Executors.newVirtualThreadPerTaskExecutor()) { | |
executor.submit(() -> {}).get(); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
System.out.println("it's me"); | |
} | |
public static void main(String[] args) { | |
System.out.println("Hello, can you hear me?"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment