//继承thread类class PrimeThread extends Thread{ long minPrime; PrimeThread(long minPrime) { this.minPrime=minPrime; } public void run(){ //computer primes larger than minPrime }}//调用方法PrimeThread p=new PrimeThread(143);p.start();//调用Runnable接口class PrimeRun implements Runnable{ long minPrime; PrimeRun(long minPrime){ this.minPrime=minPrime; } public void run(){ //compuyer primes larger than minPrime }}//调用方法PrimeRun p=new PrimeRun(143);new Thread(p).start();