`
文章列表
http://www.javamex.com/tutorials/threads/CountDownLatch.shtml   Coordinating threads with CountDownLatch   The CountDownLatch class allows us to coordinate the starting and stopping of threads. Typical uses are as follows: we can make several threads start at the same time ; we can ...
A mutable object is simply an object which can change its state after construction. For example, StringBuilder and Date are mutable objects, while String and Integer are immutable objects . A class may have a mutable object as a field.   There are two possible cases for how the st ...
Immutable objects are simply objects whose state (the object's data) cannot change after construction. Examples of immutable objects from the JDK include String and Integer . Immutable objects greatly simplify your program, since they : are simple to construct, test, and use ...
an immutable object is an object whose state cannot be modified after it is created. 不可变对象一旦被创建就它的状态就不能被修改。   A classic example of an immutable object is an instance of the Java String class. 不可变对象的一个经典的例子是String类的实例。   String s = "ABC"; s.toLowerCase();   The method toLow ...

extjs combobox 只读

实现效果: extjs combobox 只读,也就是说只能从提供的列表中选择,而不能手动输入 只需要添加一个属性:   editable: false        
Thread-safety with the Java final keyword 来源于:http://www.javamex.com/tutorials/synchronization_final.shtml   As of Java 5, the final keyword is a very important and often overlooked(漏看,忽略 ) weapon in your concurrency armoury(军械库;武器厂 ). Essentially, final can be used to make sure that wh ...
参考: http://liyuan2005.iteye.com/blog/209206   1. 当你在类中定义变量时,在其前面加上final关键字,那便是说,这个变量一旦被初始化便不可改变,这里不可改变的意思对基本类型来说是其值不可变,而对于对象变量来说其引用不可再变 。 2. 其初始化可以在两个地方,一是其定义处,也就是说在final变量定义时直接给其赋值,二是在构造函数中 。这两个 地方只能选其一,要么在定义时给值,要么在构造函数中给值,不能同时既在定义时给了值,又在构造函数中给另外的值。   3. 引用对象 can never be changed to poin ...
1. 安装vsftpd   打开终端,输入   sudo apt-get install vsftpd   2. 安装完毕后会自动生成一个帐户"ftp",/srv下也会增加一个ftp文件夹。     注意:1) 不同的ubuntu版本。这里生成的文件夹可能不一样。其他生成路径:/home/ftp              2) 不要修改/srv/ftp的权限为777.权限设置为755,匿名访问才可以。   3. 建立上传文件夹,这里设置为myftpfile    更改/srv/ftp/myftpfile目录权限。这一步很重要。否则不能创建文件和上传 ...
java中 Class.getResource用法  
学习资料来源:http://www.exampledepot.com/egs/java.nio/pkg.html   1. Converting Between a ByteBuffer an a Byte Array ByteBuffer与Byte数组的相互转化。   import java.nio.ByteBuffer; public class ConvertByteBufferByteArray { public static void main(String[] args) { //由Byte数组创建ByteBuffer byte[] bytes ...
jdon看到的一篇帖子。现记录如下。   问题: 很简单 100个请求过来了,每个请求都会有三个事件 ,accept,read write ,如果只有一个主线程轮询,每遍历到一个事件都得线性的去处理他,等处理完了再处理第二个事件,如果有个writ ...
一段很简单读文件代码   public class TestFileReader { public static void main(String[] args) { FileReader fr=null; BufferedReader br=null; try { fr=new FileReader("D:/ncolog1.txt"); br=new BufferedReader(fr); String read=null; ...
官方常见问题链接:  http://www.sencha.com/learn/Ext_FAQ_Grid        
Two JVM options are often used to tune JVM heap size: -Xmx for maximum heap size, and -Xms for initial heap size. Here are some common mistakes I have seen when using them: * Missing m, M, g or G at the end (they are case insensitive). For example, java -Xmx128 BigApp java.lang ...
转自: http://zhangjunhd.blog.51cto.com/113473/70300     在并发环境下,解决共享资源冲突问题时,可以考虑使用锁机制。 1.对象的锁 所有对象都自动含有单一的锁。 JVM负责跟踪对象被加锁的次数。如果一个对象被解锁,其计数变为0。在任务(线程)第一次给对象加锁的时候,计数变为1。每当这个相同的任务(线程)在此对象上获得锁时,计数会递增。 只有首先获得锁的任务(线程)才能继续获取该对象上的多个锁。 每当任务离开一个synchronized方法,计数递减,当计数为0的时候,锁被完全释放,此时别的任务就可以使用此资源。 ...
Global site tag (gtag.js) - Google Analytics