51CTO博客开发
如何创建泛型数组 作者:wenyinfeng 转载时,请注明原文出处,谢谢! 先复习下数组的一些特性。 数组支持向上转型,类似下面的转换是合法的自动的,不需要强制(Apple 是 Fruit 的一个子类)。 Fruit[] fruit = new Apple[10]; 但如果在不同类型的数组之间进行强制转换(不是向上转型),那么就会出
作者:wenyinfeng 转载时,请注明原文出处,谢谢! //: concurrency/SynchronizationComparisons.java // Comparing the performance of explicit Locks // and Atomics versus the synchronized keyword. import java.ut
volatile 和 atomic 原子性的区别和联系 作者:wenyinfeng 转载时,请注明原文出处,谢谢! An incorrect piece of lore that is often repeated in Java threading discussions is, "Atomic operations do not need to be synchronized.
Enum 奇怪的泛型 自限定泛型 循环泛型 作者:wenyinfeng 转载时,请注明原文出处,谢谢! public abstract class Enum<E extends Enum<E>> extends Object implements Comparable<E>, Serializable 为什么 Enum 类需要使用如下这么奇怪的泛
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号