dzÎöJava·ºÐÍ
±íÃæÉÏ¿´ÆðÀ´£¬ÎÞÂÛÓï·¨»¹ÊÇÓ¦ÓõĻ·¾³£¨±ÈÈçÈÝÆ÷Àࣩ£¬·ºÐÍÀàÐÍ£¨»òÕß·ºÐÍ£©¶¼ÀàËÆÓÚ C++ ÖеÄÄ£°å¡£µ«ÊÇÕâÖÖÏàËÆÐÔ½öÏÞÓÚ±íÃ棬Java ÓïÑÔÖеķºÐÍ»ù±¾ÉÏÍêÈ«ÔÚ±àÒëÆ÷ÖÐʵÏÖ£¬ÓɱàÒëÆ÷Ö´ÐÐÀàÐͼì²éºÍÀàÐÍÍƶϣ¬È»ºóÉú³ÉÆÕͨµÄ·Ç·ºÐ͵Ä×Ö½ÚÂë¡£ÕâÖÖʵÏÖ¼¼Êõ³ÆΪ²Á³ý£¨erasure£©£¨±àÒëÆ÷ʹÓ÷ºÐÍÀàÐÍÐÅÏ¢±£Ö¤ÀàÐÍ°²È«£¬È»ºóÔÚÉú³É×Ö½ÚÂë֮ǰ½«ÆäÇå³ý£©£¬ÕâÏî¼¼ÊõÓÐһЩÆæ¹Ö£¬²¢ÇÒÓÐʱ»á´øÀ´Ò»Ð©ÁîÈËÃÔ»óµÄºó¹û¡£ËäÈ»·¶ÐÍÊÇ Java Àà×ßÏòÀàÐÍ°²È«µÄÒ»´ó²½£¬µ«ÊÇÔÚѧϰʹÓ÷ºÐ͵Ĺý³ÌÖм¸ºõ¿Ï¶¨»áÓöµ½Í·Í´£¨ÓÐʱºòÈÃÈËÎÞ·¨ÈÌÊÜ£©µÄÎÊÌâ¡£
×¢Ò⣺±¾ÎļÙÉèÄú¶Ô JDK 5.0 Öеķ¶ÐÍÓлù±¾µÄÁ˽⡣
·ºÐͲ»ÊÇбäµÄ
ËäÈ»½«¼¯ºÏ¿´×÷ÊÇÊý×éµÄ³éÏó»áÓÐËù°ïÖú£¬µ«ÊÇÊý×黹ÓÐһЩ¼¯ºÏ²»¾ß±¸µÄÌØÊâÐÔÖÊ¡£Java ÓïÑÔÖеÄÊý×éÊÇбäµÄ£¨covariant£©£¬Ò²¾ÍÊÇ˵£¬Èç¹û Integer À©Õ¹ÁË Number£¨ÊÂʵҲÊÇÈç´Ë£©£¬ÄÇô²»½ö Integer ÊÇ Number£¬¶øÇÒ Integer[] Ò²ÊÇ Number[]£¬ÔÚÒªÇó Number[] µÄµØ·½ÍêÈ«¿ÉÒÔ´«µÝ»òÕ߸³Óè Integer[]¡££¨¸üÕýʽµØ˵£¬Èç¹û Number ÊÇ Integer µÄ³¬ÀàÐÍ£¬ÄÇô Number[] Ò²ÊÇ Integer[] µÄ³¬ÀàÐÍ£©¡£ÄúÒ²ÐíÈÏΪÕâÒ»ÔÀíͬÑùÊÊÓÃÓÚ·ºÐÍÀàÐÍ —— List<Number> ÊÇ List<Integer> µÄ³¬ÀàÐÍ£¬ÄÇô¿ÉÒÔÔÚÐèÒª List<Number> µÄµØ·½´«µÝ List<Integer>¡£²»ÐÒµÄÊÇ£¬Çé¿ö²¢·ÇÈç´Ë¡£
²»ÔÊÐíÕâÑù×öÓÐÒ»¸öºÜ³ä·ÖµÄÀíÓÉ£ºÕâÑù×ö½«ÆÆ»µÒªÌṩµÄÀàÐÍ°²È«·ºÐÍ¡£Èç¹ûÄܹ»½« List<Integer> ¸³¸ø List<Number>¡£ÄÇôÏÂÃæµÄ´úÂë¾ÍÔÊÐí½«·Ç Integer µÄÄÚÈÝ·ÅÈë List<Integer>£º
List<Integer> li = new ArrayList<Integer>();
List<Number> ln = li; // illegal
ln.add(new Float(3.1415));
ÒòΪ ln ÊÇ List<Number>£¬ËùÒÔÏòÆäÌí¼Ó Float ËƺõÊÇÍêÈ«ºÏ·¨µÄ¡£µ«ÊÇÈç¹û ln ÊÇ li µÄ±ðÃû£¬ÄÇôÕâ¾ÍÆÆ»µÁËÔ̺¬ÔÚ li ¶¨ÒåÖеÄÀàÐÍ°²È«³Ðŵ —— ËüÊÇÒ»¸öÕûÊýÁÐ±í£¬Õâ¾ÍÊÇ·ºÐÍÀàÐͲ»ÄÜбäµÄÔÒò¡£
ÆäËûµÄбäÎÊÌâ
Êý×éÄܹ»Ð±ä¶ø·ºÐͲ»ÄÜбäµÄÁíÒ»¸öºó¹ûÊÇ£¬²»ÄÜʵÀý»¯·ºÐÍÀàÐ͵ÄÊý×飨new List<String>[3] ÊDz»ºÏ·¨µÄ£©£¬³ý·ÇÀàÐͲÎÊýÊÇÒ»¸öδ°ó¶¨µÄͨÅä·û£¨new List<?>[3] ÊǺϷ¨µÄ£©¡£ÈÃÎÒÃÇ¿´¿´Èç¹ûÔÊÐíÉùÃ÷·ºÐÍÀàÐÍÊý×é»áÔì³Éʲôºó¹û£º
List<String>[] lsa = new List<String>[10]; // illegal
Object[] oa = lsa; //
Ïà¹ØÎĵµ£º
×é¼þ
¹¦ÄÜ
Com.guipei.listener. SessionListener
¼àÌý×é¼þ£¬Íê³ÉHttpSessionContextµÄ¹¦ÄÜ
index.jsp
ʵÏÖÓû§µÇ½£¬´´½¨ÐµÄsession
logout.jsp
ʵÏÖÓû§Í˳ö£¬Óû§×Ô¶¯É¾³ýsession
display.jsp
ÏÔʾÓû§µÇ½ÐÅÏ¢£¬ÔÚÓû§µÇ½ºó×Ô¶¯×ªÈë
session.jsp
Áгöµ±Ç°ËùÓеÄsession
kill.jsp
ɱµôÖ¸¶¨µÄ»á»° ......
¾ÍÊÇÒªµ½sunµÄÍøÕ¾ÏÂÔØJDK£¬jdk-6u10-beta-windows-i586-p.exe£¬ÎÒÓõÄÊÇÕâ¸ö¡£
»¹ÊÇÔÚsunµÄÍøÕ¾ÏÂÔØWTK£¬sun_java_wireless_toolkit-2_5_2-windows.exe£¬ÎÒÓõÄÕâ¸ö¡£
È»ºó¾ÍÊÇÏÈ°²×°jdkÔÙ°²×°wtk£¬Îҵݲװ·¾¶ÊÇ£ºD:\Java\jdk1.6.0_10ºÍD:\Java\WTK2.5.2
ÏÂÔØeclipse£¬ÎÒÓõÄÊÇ£ºwtp-all-in-one-sdk-R-1.5.5- ......
µ¥ÀýģʽµÄʵÏÖ·½Ê½ÓкܶàÖÖ£¬ÔÚÕâÀï½éÉÜ×î¼òµ¥µÄÁ½ÖÖ¡£
µ¥ÀýģʽÄܹ»È·±£Ò»¸öÀàÖ»ÓÐÒ»¸öʵÀý£¨Õý³£Çé¿öÎÒÃÇ¿ÉÒÔnew³öÒ»¸öÀàµÄÎÞÊý¸öʵÀý£©£¬×ÔÐÐÌṩÕâ¸öʵÀý²¢ÏòÕû¸öϵͳÌṩÕâ¸öʵÀý¡£ÏÂÃæ½éÉܵ¥ÀýģʽµÄʵÏÖ·½·¨£º
1. µ¥ÀýģʽÓÐÁ½ÖÖʵÏÖ·½Ê½£ºÒ»ÖÖÊǽ«Àൠ......
ÊØ»¤Ị̈߳¨Daemon£©
JavaÓÐÁ½ÖÖThread£º“ÊØ»¤Ïß³ÌDaemon”Óë“Óû§Ïß³ÌUser”¡£
ÎÒÃÇ֮ǰ¿´µ½µÄÀý×Ó¶¼ÊÇÓû§£¬ÊØ»¤Ïß³ÌÊÇÒ»ÖÖ“ÔÚºǫ́ÌṩͨÓÃÐÔÖ§³Ö”µÄỊ̈߳¬Ëü²¢²»ÊôÓÚ³ÌÐò±¾Ìå¡£
´Ó×ÖÃæÉÏÎÒÃǺÜÈÝÒ×½«ÊØ»¤Ïß³ÌÀí½â³ÉÊÇÓÉÐéÄâ»ú£¨virtual machine£©ÔÚÄÚ²¿´´½¨µÄ£¬¶øÓû§Ïß³ÌÔòÊÇ×Ô ......
ÒÔǰΪÁ˹ýÂËJavaµÄISO-8859-1×Ö·û£¬×ÜÊÇʹÓÃÈçÏ´úÂëÀ´´¦Àí¡£
view plaincopy to clipboardprint?
String strUserame = (String)reuqest.getParameter("username");
strUsername = new String(strUserame.getBytes("ISO-8859-1"),"UTF-8");
String strUserame ......