JavaÖÐReadOnlyµÄ¼¯ºÏ
½ñÌìÔÚCSDN¹äÂÛ̳µÄʱºòÎÞÒâÖз¢ÏÖÓÐÈËÎÊÔÚJavaÖÐÊÇ·ñÓÐReadOnly²Ù×÷·½Ê½µÄ¼¯ºÏ£¬ËµÊµ»°ÔÚÒÔÍù¿ª·¢Öи÷ÖÖ¼¯ºÏÓõĺܶ࣬µ«ÊÇÕâ¸öÎÊÌ⻹ÕæûÓÐ×¢Òâ¹ý¡£È¥JavaµÄ¹Ù·½APIÎĵµ²éÁËһϣ¬CollectionsÖл¹ÕæÓÐÕâô¸ö·½·¨Ö§³Ö£¬·½·¨ÔÐÍÈçÏ£º
unmodifiableCollection
public static <T> Collection<T> unmodifiableCollection(Collection<? extends T> c)
·µ»ØÖ¸¶¨ collection µÄ²»¿ÉÐÞ¸ÄÊÓͼ¡£´Ë·½·¨ÔÊÐíÄ£¿éΪÓû§Ìṩ¶ÔÄÚ²¿ collection µÄ“Ö»¶Á”·ÃÎÊ¡£ÔÚ·µ»ØµÄ collection ÉÏÖ´ÐеIJéѯ²Ù×÷½«“¶ÁÍê”Ö¸¶¨µÄ collection¡£ÊÔͼÐ޸ķµ»ØµÄ collection£¨²»¹ÜÊÇÖ±½ÓÐ޸Ļ¹ÊÇͨ¹ýÆäµü´úÆ÷½øÐÐÐ޸ģ©½«µ¼ÖÂÅ׳ö UnsupportedOperationException¡£
·µ»ØµÄ collection ²»»á ½« hashCode ºÍ equals ²Ù×÷´«µÝ¸øµ×²ãʵÏÖ collection£¬µ«ÕâÒÀÀµÓÚ Object µÄ equals ºÍ hashCode ·½·¨¡£ÔڵײãʵÏÖ collection ÊÇÒ»¸ö set »òÊÇÒ»¸öÁбíµÄÇé¿öÏ£¬ÓбØÒª×ñÊØÕâЩ²Ù×÷µÄж¨¡£
Èç¹ûÖ¸¶¨ collection ÊÇ¿ÉÐòÁл¯µÄ£¬Ôò·µ»ØµÄ collection Ò²½«ÊÇ¿ÉÐòÁл¯µÄ¡£
²ÎÊý£º c - ½«ÎªÆä·µ»ØÒ»¸ö²»¿ÉÐÞ¸ÄÊÓͼµÄ collection¡£ ·µ»Ø£º Ö¸¶¨ collection µÄ²»¿ÉÐÞ¸ÄÊÓͼ¡£
¿´À´¾³£¹äCSDNÂÛ̳»¹ÊÇͦÓÐÊÕ»ñµÄ¡£^_^
Ïà¹ØÎĵµ£º
¶¨Ò嶯̬´úÀíÀàDynamicProxy
package com.zte.adc.common;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
public class DynamicProxy implements InvocationHandler {
private Object object;
// °ó¶¨¹Øϵ£¬Ò²¾ÍÊǹØÁªµ½Äĸö½Ó¿Ú£¨Óë ......
JAVA¿ª·¢Õß×ȥµÄ20¸öÓ¢ÎÄÍøÕ¾
1.[http://www.javaalmanac.com] – Java¿ª·¢ÕßÄê¼øÒ»ÊéµÄÔÚÏß°æ±¾. ÒªÏë¿ìËٲ鵽ijÖÖJava¼¼ÇɵÄÓ÷¨¼°Ê¾Àý´úÂë, ÕâÊÇÒ»¸ö²»´íµÄÈ¥´¦.
2.[http://www.onjava.com] – O’ReillyµÄJavaÍøÕ¾. ÿÖܶ¼ÓÐÐÂÎÄÕÂ.
3.[http://java.sun.com] – ¹Ù·½µÄJava¿ª·¢ÕßÍ ......
LinkedListÄÚ²¿ÒÔÁ´±íÐÎʽ´æ´¢Êý¾Ý
ArrayListÄÚ²¿ÒÔÊý×éÐÎʽ´æ´¢Êý¾Ý¡£
VectorͬArrayList£¬²»¹ýËüÓëArrayList±È½ÏÆðÀ´ÊÇthread-safeµÄ¡£
HashtableÊǼ̳ÐÁËDictionary£¬ÊÇḬ̈߳²È«µÄ¡£HashMapʵÏÖÁËMap½Ó¿Ú£¬²»ÊÇḬ̈߳²È«µÄ¡£
ÈçºÎ±£Ö¤Ḭ̈߳²È«µÄ£¿Ã¿¸öÐÞ¸ÄÈÝÆ ......
package Utils.Sort;
/**
*¿ìËÙÅÅÐò£¬ÒªÇó´ýÅÅÐòµÄÊý×é±ØÐëʵÏÖComparable½Ó¿Ú
*/
public class QuickSort implements SortStrategy
{
private static final int CUTOFF = 3; //µ±ÔªËØÊý´óÓÚ´Ë ......
×÷ΪJava³ÌÐòÔ±À´Ëµ£¬×îÍ´¿àµÄÊÂÇéĪ¹ýÓÚ¿ÉÒÔÑ¡ÔñµÄ·¶Î§Ì«¹ã£¬¿ÉÒÔ¶ÁµÄÊéÌ«¶à£¬ÍùÍùÈÝÒ×ÎÞËùÊÊ´Ó¡£ÎÒÏë¾ÍÎÒ×Ô¼º¶Á¹ýµÄ¼¼ÊõÊé¼®ÖÐÌôÑ¡³öÀ´Ò»Ð©£¬°´ÕÕѧϰµÄÏȺó˳Ðò£¬ÍƼö¸ø´ó¼Ò£¬ÌرðÊÇÄÇЩÏë²»¶ÏÌá¸ß×Ô¼º¼¼ÊõˮƽµÄJava³ÌÐòÔ±ÃÇ¡£
Ò»¡¢Java±à³ÌÈëÃÅÀà
¶ÔÓÚûÓÐJava±à³Ì¾ÑéµÄ³ÌÐòÔ±ÒªÈëÃÅ£¬Ëæ±ã¶ÁʲôÈëÃÅÊé¼®¶¼Ò»Ñù£¬Õâ ......