JAVA¼¯ºÏ
Vector : »ùÓÚArrayµÄList£¬Æäʵ¾ÍÊÇ·â×°ÁËArrayËù²»¾ß±¸µÄһЩ¹¦ÄÜ·½±ãÎÒÃÇʹÓã¬Ëü²»¿ÉÄÜ×ßÈëArrayµÄÏÞÖÆ¡£ÐÔÄÜÒ²¾Í²»¿ÉÄÜ
³¬Ô½Array¡£ËùÒÔ£¬ÔÚ¿ÉÄܵÄÇé¿öÏ£¬ÎÒÃÇÒª¶àÔËÓÃArray¡£ÁíÍâºÜÖØÒªµÄÒ»µã¾ÍÊÇVector“sychronized”µÄ£¬Õâ¸öÒ²ÊÇVectorºÍ
ArrayListµÄΨһµÄÇø±ð¡£
ArrayList£ºÍ¬VectorÒ»ÑùÊÇÒ»¸ö»ùÓÚArrayÉϵÄÁ´±í£¬µ«ÊDz»Í¬µÄÊÇArrayList²»ÊÇͬ²½µÄ¡£ËùÒÔÔÚÐÔÄÜÉÏÒª±ÈVectorÓÅԽһЩ£¬µ«
Êǵ±ÔËÐе½¶àÏ̻߳·¾³ÖÐʱ£¬¿ÉÐèÒª×Ô¼ºÔÚ¹ÜÀíÏ̵߳Äͬ²½ÎÊÌâ¡£
LinkedList£ºLinkedList²»Í¬ÓÚÇ°ÃæÁ½ÖÖList£¬Ëü²»ÊÇ»ùÓÚArrayµÄ£¬ËùÒÔ²»ÊÜArrayÐÔÄܵÄÏÞÖÆ¡£Ëüÿһ¸ö½Úµã£¨Node£©¶¼°üº¬Á½·½
ÃæµÄÄÚÈÝ£º1.½Úµã±¾ÉíµÄÊý¾Ý£¨data£©£»2.ÏÂÒ»¸ö½ÚµãµÄÐÅÏ¢£¨nextNode£©¡£ËùÒÔµ±¶ÔLinkedList×öÌí¼Ó£¬É¾³ý¶¯×÷µÄʱºò¾Í²»ÓÃÏñ
»ùÓÚArrayµÄListÒ»Ñù£¬±ØÐë½øÐдóÁ¿µÄÊý¾ÝÒƶ¯¡£Ö»Òª¸ü¸ÄnextNodeµÄÏà¹ØÐÅÏ¢¾Í¿ÉÒÔʵÏÖÁË¡£Õâ¾ÍÊÇLinkedListµÄÓÅÊÆ¡£
List×ܽ᣺
1. ËùÓеÄListÖÐÖ»ÄÜÈÝÄɵ¥¸ö²»Í¬ÀàÐ͵ĶÔÏó×é³ÉµÄ±í£¬¶ø²»ÊÇKey£Value¼üÖµ¶Ô¡£ÀýÈ磺[ tom,1,c ]£»
2. ËùÓеÄListÖпÉÒÔÓÐÏàͬµÄÔªËØ£¬ÀýÈçVectorÖпÉÒÔÓÐ [ tom,koo,too,koo ]£»
3. ËùÓеÄListÖпÉÒÔÓÐnullÔªËØ£¬ÀýÈç[ tom,null,1 ]£»
4. »ùÓÚArrayµÄList£¨Vector£¬ArrayList£©Êʺϲéѯ£¬¶øLinkedList£¨Á´±í£©ÊʺÏÌí¼Ó£¬É¾³ý²Ù×÷¡£
=========================ÎÒÊÇÎ޵зָîÏß=========================================
HashSet£ºËäÈ»SetͬList¶¼ÊµÏÖÁËCollection½Ó¿Ú£¬µ«ÊÇËûÃǵÄʵÏÖ·½Ê½È´´ó²»Ò»Ñù¡£List»ù±¾É϶¼ÊÇÒÔArrayΪ»ù´¡¡£µ«ÊÇSetÔòÊÇ
ÔÚHashMapµÄ»ù´¡ÉÏÀ´ÊµÏֵģ¬Õâ¸ö¾ÍÊÇSetºÍListµÄ¸ù±¾Çø±ð¡£HashSetµÄ´æ´¢·½Ê½ÊÇ°ÑHashMapÖеÄKey×÷ΪSetµÄ¶ÔÓ¦´æ´¢Ïî¡£¿´¿´
HashSetµÄadd£¨Object obj£©·½·¨µÄʵÏ־ͿÉÒÔһĿÁËÈ»ÁË¡£
public boolean add(Object obj)
{
return map.put(obj, PRESENT) == null;
}
Õâ¸öÒ²ÊÇΪʲôÔÚSetÖв»ÄÜÏñÔÚListÖÐÒ»ÑùÓÐÖظ´µÄÏîµÄ¸ù±¾ÔÒò£¬ÒòΪHashMapµÄkeyÊDz»ÄÜÓÐÖظ´µÄ¡£
LinkedHashSet£ºHashSetµÄÒ»¸ö×ÓÀ࣬һ¸öÁ´±í¡£
TreeSet£ºSortedSetµÄ×ÓÀ࣬Ëü²»Í¬ÓÚHashSetµÄ¸ù±¾¾ÍÊÇTreeSetÊÇÓÐÐòµÄ¡£ËüÊÇͨ¹ýSortedMapÀ´ÊµÏֵġ£
Set×ܽ᣺
1. SetʵÏֵĻù´¡ÊÇMap£¨HashMap£©£»
2. SetÖеÄÔªËØÊDz»ÄÜÖظ´µÄ£¬Èç¹ûʹÓÃadd(Object obj)·½·¨Ìí¼ÓÒѾ´æÔڵĶÔÏó£¬Ôò»á¸²¸ÇÇ°ÃæµÄ¶ÔÏó
=========================ÎÒÊÇÎ޵зָîÏß===========
Ïà¹ØÎĵµ£º
package sort;
public class RadixSort {
// Çóx ÊýµÚdλÉϵÄÊý×Ö£¬ÀýÈç12345£¬Ê®Î»Êý×ÖÊÇ4 12345/10%10=4
// d=0 ±íʾ¸öλ £»d=1 ±íʾʮλ...ÒÀ´ÎÀàÍÆ
public static int digit(int d,int x){
return x/(int)Math.pow(10, d)%10;
}
public static void ra ......
Http´¦Àí²½Öè:
1.¿Í»§¶ËºÍWeb·þÎñÆ÷½¨Á¢Á¬½Ó;
2.¿Í»§¶Ë·¢ËÍhttpÇëÇó;
3.·þÎñÆ÷¶Ë½ÓÊÕ¿Í»§¶ËµÄhttpÇëÇó,Éú³ÉhttpÏìÓ¦»Ø·¢;
4.·þÎñÆ÷¹Ø±ÕÁ¬½Ó.
ÇëÇó:ÇëÇóÐÐ,ÇëÇóÍ·,¿ÕÐÐ,ÏûÏ¢Ìå.
ÏìÓ¦:״̬ÐÐ,ÏìӦͷ,¿ÕÐÐ,ÏûÏ¢Ìå.
Servlet:
Ìصã:1.ÆÕͨµÄJava´úÂë,ʹÓÃÁËеÄAPI;
2.²»ÊôÓÚJ2SE,¾ßÓе¥¶ÀµÄ¹æ·¶;
3.¼Ì³ÐÓÚHttpS ......
ÏñÒƶ¯Íø¹ØÒ»Ñù£¬iisforwardÕâ¸öISAPI¹ýÂËÆ÷Ò²»á¶Ôrequest¶ÔÏó½øÐÐÔÙ°ü×°£¬¸½¼ÓһЩWLSÒªÓõÄÍ·ÐÅÏ¢¡£ÕâÖÖÇé¿öÏ£¬Ö±½ÓÓÃrequest.getRemoteAddr()ÊÇÎÞ·¨È¡µ½ÕæÕýµÄ¿Í»§IPµÄ¡£
ʵ¼ÊµÄiisforward¸½¼ÓÍ·ÈçÏ£º
WL-Proxy-Client-IP=211.161.1.239
Proxy-Client-IP=211.161.1.239
X-Forwarded-For=211.161.1.239
WL- ......
1. ÄãÐèÒª¾«Í¨ÃæÏò¶ÔÏó·ÖÎöÓëÉè¼Æ£¨OOAOOD£©¡¢É漰ģʽ£¨GOF£¬J2EEDP£©ÒÔ¼°×ÛºÏģʽ¡£ÄãÓ¦¸ÃÁ˽âUML£¬ÓÈÆäÊÇclass¡¢object¡¢interactionÒÔ¼°statediagrams. ¡¡¡¡2. ÄãÐèҪѧϰJavaÓïÑԵĻù´¡ÖªÊ¶ÒÔ¼°ËüµÄºËÐÄÀà¿â£¨collections¡¢serialization¡¢streams¡¢networking¡¢multithreading¡¢reflection¡¢event¡¢handling¡¢N ......
import java.io.*;
class FileTest
{
public static void main(String[] args) throws Exception
{
//File f=new File("1.txt");
//f.createNewFile();
//f.mkdir();
//File f=new File("E:\\JavaLesson\\Lesson7\\1.txt");//ÔÚWindowsϵͳÏÂ,Óþø¶Ô ......