Created
July 30, 2020 17:26
-
-
Save AnjaliManhas/bea4d2291d59586a29dc97423240e8d1 to your computer and use it in GitHub Desktop.
assigning a task to ExecutorService using submit() method
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
package com.wordpress.compilationerrors; | |
import java.lang.Runnable; | |
import java.lang.*; | |
import java.util.concurrent.*; | |
// assigning a task to ExecutorService using submit() method | |
public class ExecutorServiceExample { | |
public static void main(String[] args) { | |
ExecutorService executorService = Executors.newSingleThreadExecutor(); | |
executorService.submit(new Runnable() { | |
@Override | |
public void run() { | |
System.out.println("ExecutorService"); | |
} | |
}); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment