Created
July 5, 2015 09:44
-
-
Save virajpurang3/54141fb457134eb2c836 to your computer and use it in GitHub Desktop.
Runnable Interface
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
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