Skip to content

Instantly share code, notes, and snippets.

@electrical electrical/Service.java Secret
Created Mar 27, 2016

Embed
What would you like to do?
ldn-mbp-rpijnenburg:test rpijnenburg$ javac Service.java
Service.java:11: error: <identifier> expected
executorService.execute(new Runnable() {
^
Service.java:11: error: illegal start of type
executorService.execute(new Runnable() {
^
Service.java:11: error: ')' expected
executorService.execute(new Runnable() {
^
Service.java:11: error: ';' expected
executorService.execute(new Runnable() {
^
Service.java:11: error: illegal start of type
executorService.execute(new Runnable() {
^
Service.java:11: error: <identifier> expected
executorService.execute(new Runnable() {
^
Service.java:11: error: ';' expected
executorService.execute(new Runnable() {
^
Service.java:15: error: class, interface, or enum expected
});
^
Service.java:17: error: class, interface, or enum expected
executorService.shutdown();
^
Service.java:18: error: class, interface, or enum expected
}
^
10 errors
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.lang.Runnable;
public class Service {
ExecutorService executorService = Executors.newSingleThreadExecutor();
executorService.execute(new Runnable() {
public void run() {
System.out.println("Asynchronous task");
}
});
executorService.shutdown();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.