在Nonblocking I/O中最重要的也就是三个类
引用java.nio.channels.SelectableChannel
java.nio.channels.Selector
java.nio.channels.SelectionKey
1 SelectableChannel
默认情况下channels是阻塞的.我们可以设置一个channel为nonblock的,可是并不是所有的channel都可以设置为nonblock的,比如file channels就不能设置为nonblock.所有提供nonblocking I/O的类都是SelectableChannel的子类.
我们 ...
Grizzly看起来很诱人的说..
http://www.scribd.com/doc/267405/-Java-NIO-with-Grizzly
java有两种类型的classload,一种是user-defined的,一种是jvm内置的bootstrap class loader,所有user-defined的class loader都是java.lang.ClassLoader的子类.
而jvm内置的class loader有3种,分别是 Bootstrap ClassLoader, Extension ClassLoader(即ExtClassLoader),System ClassLoader(即AppClassLoader).
而jvm加载时的双亲委派 就不说了,javaeye上有很多文章都有介绍..
可以分别看一下他们的 ...
上周看了一下java的范型,只有一个感觉,那就是真是个空壳子,太多的限制了。
特别是 类型擦除,直接字节码里把所有的类型都变成了object,简直无语.
这就是所谓的类型擦除:
引用
You cannot instantiate a type represented only as a type parameter, nor can you create an array of such a type. So for a type variable T you can't do newT() or newT[n] .
You cannot create an array whose ...
前几天帮同学作了个很小的project,
引用Example1. Assume the content of the file is:
abc,def
abc def! ghi jkl?
xyz abc ppp
xyz xyz def
It contains fouro bjects.The first object consists of twotokens abc and def.The last object consists of three tokens xyz, xyz,def.
The similarity between the first object and t ...
很早以前学算法的时候写的 ^_^。
1. BubbleSort
import java.util.*;
public class BubbleSort{
public void sort(int[] a){
for(int i=0;i
for(int j=a.length-1;j>=i+1;j--){
if(a[j]
int tmp =a[j];
a[j]=a[j-1];
a[j-1]=tmp;
}
}
}
}
public static void main(String[] args){
int[] a = {1,6,3,8,1,56,};
BubbleSo ...
原帖地址 http://www.oreillynet.com/onjava/blog/2006/11/open_java_changes_everything.html
Now that the dust is beginning to settle on Sun’s Decision to open source Java , what does it actually mean for you? That’s you as in a Business user, you as in a Java Developer , and you as a member of the wide ...
下一代编程语言的发展和计算机系统的部署方式
我举个例子,分布式网络的设计和计算,在一学期过后,一般最差的学生,也该用cmu的模型分析工具作过一个以太网的架构设计,具体服务器,客户端接程序的类图设计,并且需要用Java,结合OSI模型第四层,和第三层的协议进行编程。大量的测试和调整网络的路由情况,尤其是局部的负载调整,自己模拟了路由器集群的工作,而这些不要照搬cisco的协议。完全自己分析,反复捕捉一个路由器,一个网络工作,需要哪些东西;比如说,一个第三层的路由协议要自己定义,一个第四层的传输协议要自己做。其实tcp/Ip协议远远不够好, 所以我们在OSI三,四层之间加入了一个物理端口层,这 ...







评论排行榜