what is a callable in java

Solutions on MaxInterview for what is a callable in java by the best coders in the world

showing results for - "what is a callable in java"
Giacomo
13 Feb 2020
1public class EventLoggingTask implements  Runnable{
2    private Logger logger
3      = LoggerFactory.getLogger(EventLoggingTask.class);
4
5    @Override
6    public void run() {
7        logger.info("Message");
8    }
9}
Kenna
21 Jul 2020
1public void executeTask() {
2    executorService = Executors.newSingleThreadExecutor();
3    Future future = executorService.submit(new EventLoggingTask());
4    executorService.shutdown();
5}
Carolina
24 Feb 2017
1public interface Runnable {
2    public void run();
3}