Java SE 多线程 线程生命周期
package thread;
class ThreadTest4 implements Runnable{
private boolean flag=true;
public void stopMe(){
flag=false;
}
public void run() {
while (flag){
System.out.println(Thread.currentThread().getName()+" is running ");
}
}
}
public class ThreadLife {
public static void main(String[] args) {
ThreadTest4 tt4=new ThreadTest4();
new Thread(tt4).start();
for(int i=0;i<100;i++){
if(i==50)
tt4.stopMe();
System.out.println("i="+i+" "+Thread.currentThread().getName()+" is running ");
}
}
}
相关文档:
Reflection 的简单应用,包括field, method,constructor的应用。
package com.gaoqian.reflection;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.Typ ......
文中引用了孙老师的代码,并注明。
import java.io.*;
import java.net.*;
public class EchoServer {
private int port=8888;
private ServerSocket serverSocket;
public EchoServer() throws IOException {
serverSocket = new ServerSocket(port);
System.out.println("服务器启动");
......
package demo;
class TestA{
public int devide(int x,int y) throws ArithmeticException , DevideByMinusException{
if(y<0)
throw new DevideByMinusException("被除数为负",y);
int result=x/y;
return result;
}
}
public class TestE ......
0
Java Web应用在ARM Linux平台上的实现
Posted in 硕博论文 at 十一月 12th, 2009 / No Comments »
王伟,周兰江,刘礼东,解云霄
(昆明理工大学信息工程与自动化学院,云南昆明650051)
1引言
随着网络信息技术的飞速发展,Web技术越来越多的用在控制领域,客户端只需连接以太网,取得访问权限,就可以访 ......