12 2012 档案

摘要:来源:http://www.cnblogs.com/whgw/archive/2011/10/05/2199535.htmlJava中单利模式有三种: 懒汉式、饿汉式、登记试饿汉式:public class Singleton { private Singleton() {} private static Singleton instance = new Singleton(); public static Singleton getInstance() { return instance; }}懒汉式:public class Singleton { ... 阅读全文
posted @ 2012-12-18 18:48 wouldguan 阅读(195) 评论(0) 推荐(0) 编辑
摘要:原帖在:http://www.coo8ger.com/?p=141服务器端代码:import java.io.*;import java.net.*;public class MyServer { public static void main(String[] args) throws IOException { ServerSocket server = new ServerSocket(5678); Socket client = server.accept(); BufferedReader in = new BufferedReader... 阅读全文
posted @ 2012-12-17 22:37 wouldguan 阅读(159) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示