public void start()
{ if(mythread==null){
mythread=new Thread();
******************* new Thread(this);
{ if(mythread==null){
mythread=new Thread();
******************* new Thread(this);
解决方案 »
- 请问,哪款Java剖析工具,可以显示函数的调用过程?
- 关于Swing的一个问题
- 学习PHP对学习Java入门有帮助吗?
- 装好MyEclipse7.1后,发现 configuration里 缺少文件
- JOptionPane.class.getField(s).getInt(null);是什么意思?
- 高分求教一个基础问题?关于程序的编译后运行
- post请求页面的问题
- 请教一个java操作数据库的问题!
- 又有一个问题:怎么判断用户输入是一个汉字还是一个字母或数字??
- 请问大家几个技术问题!!谁能回答阿!比较着急!:)
- 接口是什么啊
- *****弟兄们,遇到难题了,用eclipse用其内置的cvs通过代理服务器登录国外的cvs服务器的问题,
如:
The other way to create a thread is to declare a class that implements the Runnable interface. That class then implements the run method. An instance of the class can then be allocated, passed as an argument when creating Thread, and started. The same example in this other style looks like the following: -------------------------------------------------------------------------------- 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();