- 浏览: 11329 次
- 性别:
- 来自: 体育仓库
最新评论
-
ravenex:
chong_zh 写道例子中的Cindy,Mom,Grandm ...
谁是initiating loader -
chong_zh:
例子中的Cindy,Mom,Grandma并没有载入委派关系, ...
谁是initiating loader -
beyondqinghua:
有时间慢慢看,收藏先!
几种排序算法的对比
文章列表
《深入Java虚拟机》第二版(很老的那本,Bill Venners写的,有中文翻译那本)第八章讲解类加载器用了个Cindy、Mom、Grandma的例子。但那个例子是错的。发了邮件到jdk6-dev邮件列表,等待答复。顺便发这边大家讨论。
那个例子说,Cindy的parent是Mom,Mom的parent是Grandma,Grandma的parent是null也就是bootstrap class loader。
Cindy尝试加载java.io.FileReader会委派给Mom,Mom委派给Grandma,Grandma委派给bootstrap,bootstrap成功加载并一层层把Class ...
链接:装配脑袋:手工解析.NET完全限定类型名称
想起CLR 2.0开始支持variance,在MSIL里声明泛型接口或者委托时可以在泛型参数前加上+或者-来表示covariance和contravariance。全限定名称里包含了泛型参数的信息,感觉也应该包含variance信息。
实验如下:
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 2:0:0:0
}
.assembly variance
{
.hash algorithm 0x00008004
...
- 2009-09-08 13:53
- 浏览 1221
- 评论(0)
Java语言规范15.28规定了Java的常量表达式可以表示原始类型或者字符串;它们不但可以由纯粹的字面量构成,还可以包含能在编译时确定结果的运算,包括+、-、~、!、*、/、%、<<、>>、>>>、<、>、<=、>=、==、!=、&、|、^、&&、||、? :,还有指向上述类型的常量(final变量)的表达式。
所以下面的abc不会在运行时创建多个String,而是编译时就已经合并为一个String了。
public class JavaConstantExpression {
public ...
- 2009-09-02 11:04
- 浏览 2083
- 评论(0)
如果in-place做quick sort,选择放置pivot的位置会影响到代码细节。
同样的实现方式,选择第一个元素为pivot时,恢复pivot位置就得以hi为准。
public class TestQuickSort {
public static void main(String[] args) {
int[] arr = { 1, 4, 2, 3, 6, 5, 0 };
quickSort(arr, 0, arr.length - 1);
for (int i : arr) System.out.println(i);
}
pu ...
- 2009-09-02 02:20
- 浏览 875
- 评论(0)
Windows Mobile Developer Center
Windows Mobile 6 SDK Refresh
Windows Mobile 6.5 Developer Tool Kit
从Windows Mobile 5开始,可以通过WindowsMobile.PocketOutlook来访问POOM(PocketOutlook Object Model)
有待更新
- 2009-09-01 23:22
- 浏览 1185
- 评论(0)
引用Programming: Sort Testing
Your task this week is to implement four sorts, and do experiments to see how fast they run for different sizes and types of input data sets. The sorts are: selection sort, insertion sort, bubble sort and merge sort.
We're interested in two "modes" for your pro ...
引用Programming: String Mutation
Richard Dawkins, in his book The Blind Watchmaker, explains his much-debated experiment known as the weasel program. This algorithm is designed to show that random mutations in DNA can create complex life forms through natural selection, rather than the will of an inte ...
引用Programming: The Birthday Paradox
There's a parlor trick known as the Birthday Paradox where in any group of 23 or more people, chances are more than 50% that some two people have the same birthday. This is counter-intuitive to statistical lay people, but can be proven mathematically. Still, certa ...