发现commons-io包里有一个类叫ThreadMonitor,居然不是public的!

这么有意思的类居然不是public,还能不能愉快的玩耍了。。。

[code="java"]
/**

  • Monitors a thread, interrupting it if it reaches the specified timeout.
  • This works by sleeping until the specified timeout amount and then
  • interrupting the thread being monitored. If the thread being monitored
  • completes its work before being interrupted, it should interrupt()
  • the monitor thread.
  • long timeoutInMillis = 1000;
  • try {
  • Thread monitor = ThreadMonitor.start(timeoutInMillis);
  • // do some work here
  • ThreadMonitor.stop(monitor);
  • } catch (InterruptedException e) {
  • // timed amount was reached
  • }
  • *
  • @version $Id$ */[/code]

方法不是公共的很正常啊 别人写的保护方法而已 你也可以写保护方法 看好你哦!!呵呵

什么意思?????