Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java ¼¯ºÏÀà


¼¯ºÏCollection½Ó¿Ú
--Collection ÊÇÈκζÔÏó×é£¬ÔªËØ¸÷×Ô¶ÀÁ¢£¬Í¨³£ÓµÓÐÏàͬµÄÌ×ÓùæÔò¡£Set ListÓÉËüÅÉÉú¡£
»ù±¾²Ù×÷ Ôö¼ÓÔªËØadd(Object obj); addAll(Collection c);
ɾ³ýÔªËØ remove(Object obj); removeAll(Collection c);
Çó½»¼¯ retainAll(Collection c);
ɾ³ýÔªËØ remove(Object obj); removeAll(Collection c);
Çó½»¼¯ retainAll(Collection c);
·ÃÎÊ/±éÀú¼¯ºÏÔªËØµÄºÃ°ì·¨ÊÇʹÓÃIterator½Ó¿Ú(µü´úÆ÷ÓÃÓÚÈ¡´úEnumeration)
Public interface Iterator{
  Public Boolean hasNext(};
  ¡¡ Public Object next(};
   ¡¡Public void remove(};
}
Ò»¡¢set
ÎÞÖØ¸´¡¢ÎÞÐò
HashSet-»ùÓÚÉ¢ÁбíµÄ¼¯£¬¼Ó½øÉ¢ÁбíµÄÔªËØÒªÊµÏÖhashCode()·½·¨ÒÔÅжÏÊÇ·ñΪͬһ¸ö¶ÔÏó£¬ÎÞ˳Ðò¡¢ÎÞÖØ¸´¡£
LinkedHashSet-ÔÚHashSetÖмÓÈëÁËÁ´±íÊý¾Ý½á¹¹£¬ÓÐ˳Ðò
TreeSet-¿ÉÒÔÅÅÐò£¬ÐèҪʵÏÖComparable½Ó¿Ú£¬²¢ÊµÏÖÆäcompareTo()·½·¨£¬ÒÔÅÅÐò¡£
¶þ¡¢List
ÓÐÖØ¸´¡¢ÓÐÐò
ArrayList(Êý×é±í)- ÓÐÖØ¸´¡¢ÓÐ˳Ðò¡£ÀàËÆÓÚVector£¬¶¼ÓÃÓÚËõ·ÅÊý×éά»¤¼¯ºÏ¡£Çø±ð£º
Ò».ͬ²½ÐÔ:VectorÊÇḬ̈߳²È«µÄ£¬Ò²¾ÍÊÇ˵ÊÇͬ²½µÄ£¬¶øArrayListÊÇÏß³ÌÐò²»°²È«µÄ£¬²»ÊÇͬ²½µÄ
¶þ.Êý¾ÝÔö³¤:µ±ÐèÒªÔö³¤Ê±,VectorĬÈÏÔö³¤ÎªÔ­À´Ò»Å࣬¶øArrayListÈ´ÊÇÔ­À´µÄÒ»°ë
LinkedList(Á´±í)-ÊÇË«ÏòÁ´±í£¬Êʺϱä¸üºÜ¶àµÄList¡£
ÓÃÔÚFIFO£¬ÓÃaddList()¼ÓÈëÔªËØ removeFirst()ɾ³ýÔªËØ
ÓÃÔÚFILO,ÓÃaddFirst()/removeLast()
ListIteratorÌṩ˫Ïò±éÀúnext() previous()£¬¿Éɾ³ý¡¢Ìæ»»¡¢Ôö¼ÓÔªËØ
Èý¡¢Map
--ÓÃÓڹؼü×Ö/ÊýÖµ¶Ô£¬½Ï¸ßµÄ´æÈ¡ÐÔÄÜ¡£²»ÔÊÐíÖØ¸´µÄkey£¬µ«ÔÊÐíÖØ¸´µÄValue¡£
´¦ÀíMapµÄÈýÖÖ¼¯ºÏ
¹Ø¼ü×Ö¼¯KeySet() ÊýÖµ¼¯value()   ÏîÄ¿¼¯enrySet()
Ëĸö¾ßÌå°æ±¾
HashMap-É¢ÁбíµÄͨÓÃÓ³Éä±í£¬ÎÞÐò£¬¿ÉÔÚ³õʼ»¯Ê±É趨Æä´óС£¬×Ô¶¯Ôö³¤¡£
LinkedHashMap-À©Õ¹HashMap£¬¶Ô·µ»Ø¼¯ºÏµü´úʱ£¬Î¬»¤²åÈë˳Ðò
WeakHashMap-»ùÓÚÈõÒýÓÃÉ¢ÁбíµÄÓ³Éä±í£¬Èç¹û²»±£³ÖÓ³Éä±íÍâµÄ¹Ø¼ü×ÖµÄÒýÓã¬ÔòÄÚ´æ»ØÊÕ³ÌÐò»á»ØÊÕËü
TreeMap-»ùÓÚÆ½ºâÊ÷µÄÓ³Éä±í  
ËÄ¡¢collectionsÀ࣬ÓÃÓÚͬ²½¼¯ºÏ£¬»¹Äܸı伯ºÏÖ»¶Á·½Ê½µÄÀà
e.g.:
Map mp=new HashMap();
mp=Collections.synchronizedMap(mp); //Éú³ÉḬ̈߳²È«µÄÓ³Éä±í
mp=Collections.unmodifiableMap(mp); //Éú³ÉÖ»¶ÁÓ³Éä±í
Îå¡¢HashtableÀà
ÊÇDictionary½á¹¹µÄ¾ßÌåʵÏÖ¡£  
1¡¢Collection


Ïà¹ØÎĵµ£º

java·´Éä³£¼û·½·¨

»ñÈ¡classÀà·½·¨£º
1£¬getClass 2£¬Class.forName() 3,ÓÃ.class
public Field[] getDeclaredFields()
·µ»ØµÄÊÇij¸öÀàÀïµÄËùÓÐÀàÐ͵ıäÁ¿£¬²»°üÀ¨¼Ì³Ð¸¸ÀàµÄ
public Field[] getDeclaredFields(String name)
·µ»ØÌض¨Ãû×Ö
public Field[]  getFields()
·µ»ØµÄÊÇij¸öÀàÀïµÄËùÓÐpublicÀàÐ͵ıäÁ¿£¬°üÀ¨¼Ì³Ð¸¸Àൠ......

treePanel json javaºǫ́

 function createTreeMenu(){//´´½¨Ò»¸öÊ÷µÄÃæ°å
 var treeMenu = new Ext.tree.TreePanel({
  lines : true,
  minSize : 150,
  border : false,
  root : new Ext.tree.AsyncTreeNode({text : 'root'}),
  loader : new Ext.tree.TreeLoader({dataUr ......

JavaÖÐʵÏÖ Client

1.Ïà¹ØÀàµÄ½éÉÜ
·þÎñÆ÷³ÌÐò²»Í¬ÓÚ¿Í»§»ú¶ËµÄ³ÌÐò£¬ËüÐèÒª³õʼ»¯Ò»¸ö¶Ë¿Ú½øÐмàÌý£¬Óöµ½Á¬½Óºô½Ð£¬²ÅÓëÏàÓ¦µÄ¿Í»§»ú½¨Á¢Á¬½Ó¡£Java.net°üµÄServerSocketÀà°üº¬Á˱àд·þÎñÆ÷ϵͳµÄÈ«²¿ËùÐ蹦ÄÜ£¬¶ø¿Í»§¶ËÈí¼þͨ³£Ê¹ÓÃjava.net°üÖеĺËÐÄÀàSocketÓë·þÎñÆ÷µÄij¸ö¶Ë¿Ú½¨Á¢Á¬½Ó¡£
2.µ¥Ï߳̿ͻ§¶Ë³ÌÐò½¨Á¢²½Ö裺
1£©½¨Á¢socket£ ......

ÊÕ²Ø java×·¼ÓдÎļþµÄ·½·¨

 import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.RandomAccessFile;
/**
 * ÃèÊö£º×·¼ÓÄÚÈݵ½Îļþĩβ
 * @author Administrator
 *
 */
public class ......

javaµ¥Ì¬Ä£Ê½½²½â

µ¥Ì¬¶¨Òå:
        SingletonģʽÖ÷Òª×÷ÓÃÊDZ£Ö¤ÔÚJavaÓ¦ÓóÌÐòÖУ¬Ò»¸öÀàClassÖ»ÓÐÒ»¸öʵÀý´æÔÚ¡£
        Singletonģʽ¾ÍΪÎÒÃÇÌṩÁËÕâÑùʵÏֵĿÉÄÜ¡£Ê¹ÓÃSingletonµÄºÃ´¦»¹ÔÚÓÚ¿ÉÒÔ½ÚÊ¡Äڴ棬ÒòΪËüÏÞÖÆÁËʵÀýµÄ¸öÊý£¬ÓÐÀûÓÚJavaÀ¬»ø»ØÊÕ£¨garbage col ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ