Created
August 20, 2025 12:52
-
-
Save Audhil/99d8f318708acac887754cf7c82f0fe3 to your computer and use it in GitHub Desktop.
All about Daemons!
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
import java.util.concurrent.Executor; | |
public class ExecutorsSample { | |
public static void main(String[] args) { | |
// Executor executor = new Executor() { | |
// @Override | |
// public void execute(Runnable command) { | |
// command.run(); | |
// } | |
// }; | |
// we can simply write as follows | |
Executor executor = Runnable::run; | |
// placing runnable in executor | |
executor.execute(new Runnable() { | |
@Override | |
public void run() { | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment