Skip to content

Instantly share code, notes, and snippets.

@Audhil
Created August 20, 2025 12:52
Show Gist options
  • Save Audhil/99d8f318708acac887754cf7c82f0fe3 to your computer and use it in GitHub Desktop.
Save Audhil/99d8f318708acac887754cf7c82f0fe3 to your computer and use it in GitHub Desktop.
All about Daemons!
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