摘要:
1. Original Question: https://forums.oracle.com/forums/thread.jspa?threadID=1142455Hi All,i'm using ScheduledThreadPoolExecutor (with jdk 1.5) and I'm wondering about exception handling. My first goal is to handle the exceptions thrown by my Runnable task during its executions. I tried doing 阅读全文
摘要:
原文来自:https://www.ibm.com/developerworks/java/library/j-jtp06197/Java theory and practice: Managing volatilityGuidelines for using volatile variablesBrian Goetz(brian.goetz@oracle.com), Senior Staff Engineer, Sun MicrosystemsSummary: The Java™ language contains two intrinsic synchronization mechanism 阅读全文
摘要:
大部分转载自参考资料:http://www.ibm.com/developerworks/cn/java/l-javaassertion/index.html assertion(断言)在软件开发中是一种常用的调试方式,assertion就是在程序中的一条语句,它对一个boolean表达式进行检查,一个正确程序必须保证这个boolean表达式的值为true;如果该值为false,说明程序已经处于不正确的状态下,系统将给出警告或退出。一般来说,assertion用于保证程序最基本、关键的正确性。assertion检查通常在开发和测试时开启。为了提高性能,在软件发布后,assertion检查通常. 阅读全文
摘要:
尤其是在有package、import和import *的情况下,各种混乱,IDE用久了,命令行是硬伤,有必要复习一下:假设有 g:/src/simple/Foo.java最好的practice是将编译后的class文件全部集中放到bin目录下,bin和src在同一目录,先把bin创建好,g:/bin注意这里有import *1 package simple;2 3 import net.mindview.util.*;4 5 public class Foo {6 public static void main(String[] args) {7 Print.prin... 阅读全文
摘要:
大概是如下步骤,仅以截图示意:效果:注:jar包中的文件多为class文件 阅读全文
摘要:
在阅读TIJ学习JAVA SE的时候感觉对Serializable和Externalizable之间的区别和各自的用途感觉不是很清楚,除了查看JDK Documentation之外,还Google了一些资料,看到了部分比较简明扼要的解释,摘录如下【摘自stackoverflow.com】Question:What is the difference between Serializable and Externalizable in Java?Answer 1:To add to the other answers, by implementatingjava.io.Serializable, 阅读全文