摘要:
服务端程序: public class Demo { public static void main(String[] args) { // TODO 自动生成的方法存根 try { ServerSocket server =new ServerSocket(6666); Socket client 阅读全文
摘要:
public class Demo { //通过管道完成文件的拷贝 public static void main(String[] arg) { PipedInputStream in =new PipedInputStream(); PipedOutputStream out; try { ou 阅读全文
摘要:
1、在start之前,setDaemon。 该现场就成为守护线程了。 2、守护现线程并不是主线程结束,子线程(守护线程)也跟着结束。而是守护线程在没有用户线程运行的情况伴随着JVM退出而结束。 示例代码: public class Demo { public static void main(Str 阅读全文