11 2012 档案

摘要:If you have ever programmed using Java IO, you will quickly run into a situation in which a class creates data on an OutputStream and you need to send it to another class that expects to read the data from an input stream. You'll soon be asking the question, "How do I convert an OutputStrea 阅读全文
posted @ 2012-11-12 16:33 mark_xue 阅读(297) 评论(0) 推荐(0)
摘要:java虚拟机只有所有运行的线程为后台线程时退出。这就是说我们创建一个线程,如果将它设置成daemon的,那么即使它还在执行,虚拟机在完成其他任务后也会退出。测试代码: 1 package org.foo.go; 2 class Go { 3 public static void main(String[] args) 4 { 5 Thread myThread = new Thread (){ 6 public void run() 7 { 8 while(true)... 阅读全文
posted @ 2012-11-08 17:39 mark_xue 阅读(517) 评论(0) 推荐(0)