摘要:
1. 地址获取 和 编码解码public class Net { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub InetAddress ip = InetAddress.getByName("127.0.0.1"); System.out.println("send msg is " + ip.isReachable(5000)); System.out.println("HostAdd " 阅读全文
摘要:
1. 创建线程(一)定义线程类, 继承Thread 并重写run(), run()称为线程体。单继承限制,尽量少用。class firstThread extends Thread { //创建线程类public void run(){ //重写run()for(int i=0; i" + i);}}public class main {public static void main(String[] args) {firstThread ft = new firstThread();//生成线程类对象ft.start();//启动线程 不能直接ft.run()for(int i=0 阅读全文