Skip to content

Instantly share code, notes, and snippets.

@virajpurang3
Created July 5, 2015 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save virajpurang3/54141fb457134eb2c836 to your computer and use it in GitHub Desktop.
Save virajpurang3/54141fb457134eb2c836 to your computer and use it in GitHub Desktop.
Runnable Interface
class PrimeRun implements Runnable {
long minPrime;
PrimeRun(long minPrime) {
this.minPrime = minPrime;
}
public void run() {
// compute primes larger than minPrime
}
}
The following code would then create a thread and start it running:
PrimeRun p = new PrimeRun(143);
new Thread(p).start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment