JavaSocket编程的一个简单例子
摘要:1 // 客户端程序 2 import java.io.*; 3 import java.net.ServerSocket; 4 import java.net.Socket; 5 6 public class user{ 7 public static void main(String[] args) throws InterruptedException { 8 String s = null; 9 Socket mysocket;10 DataOutputStream out = null;11 DataInpu...
阅读全文
posted @
2012-11-21 10:17
ocr
阅读(3077)
推荐(0)
Java一个多线程的例子
摘要:1 class SimpleThread extends Thread{ 2 public SimpleThread(String str){ 3 super(str); 4 } 5 6 public void run(){ //重写run 7 for(int i=0; i<10; i++) 8 { 9 System.out.println(i + " "+ getName());10 11 try{12 ...
阅读全文
posted @
2012-11-21 10:13
ocr
阅读(268)
推荐(0)