¹ØÓÚ Java ¶ÔÏóÐòÁл¯Äú²»ÖªµÀµÄ 5 ¼þÊÂ
ÊýÄêÇ°£¬µ±ºÍÒ»¸öÈí¼þÍŶÓÒ»ÆðÓà Java ÓïÑÔ±àдһ¸öÓ¦ÓóÌÐòʱ£¬ÎÒÌå»áµ½±ÈÒ»°ã³ÌÐòÔ±¶àÖªµÀÒ»µã¹ØÓÚ Java ¶ÔÏóÐòÁл¯µÄ֪ʶËù´øÀ´µÄºÃ´¦¡£
¹ØÓÚ±¾ÏµÁÐ
Äú¾õµÃ×Ô¼º¶® Java ±à³Ì£¿ÊÂʵÉÏ£¬´ó¶àÊý³ÌÐòÔ±¶ÔÓÚ Java ƽ̨¶¼ÊÇdz³¢ÔòÖ¹£¬Ö»Ñ§Ï°ÁË×ãÒÔÍê³ÉÊÖÍ·ÉÏÈÎÎñµÄ֪ʶ¶øÒÑ¡£
´óÔ¼Ò»ÄêÇ°£¬Ò»¸ö¸ºÔð¹ÜÀíÓ¦ÓóÌÐòËùÓÐÓû§ÉèÖõĿª·¢ÈËÔ±£¬¾ö¶¨½«Óû§ÉèÖô洢ÔÚÒ»¸ö Hashtable ÖУ¬È»ºó½«Õâ¸ö Hashtable ÐòÁл¯µ½´ÅÅÌ£¬ÒÔ±ã³Ö¾Ã»¯¡£µ±Óû§¸ü¸ÄÉèÖÃʱ£¬±ãÖØн« Hashtable дµ½´ÅÅÌ¡£
ÕâÊÇÒ»¸öÓÅÑŵġ¢¿ª·ÅʽµÄÉèÖÃϵͳ£¬µ«ÊÇ£¬µ±ÍŶӾö¶¨´Ó Hashtable ǨÒƵ½ Java Collections ¿âÖÐµÄ HashMap ʱ£¬Õâ¸öϵͳ±ãÃæÁÙ±ÀÀ£¡£
Hashtable ºÍ HashMap ÔÚ´ÅÅÌÉϵĸñʽÊDz»Ïàͬ¡¢²»¼æÈݵġ£³ý·Ç¶Ôÿ¸ö³Ö¾Ã»¯µÄÓû§ÉèÖÃÔËÐÐijÖÖÀàÐ͵ÄÊý¾Ýת»»ÊµÓóÌÐò£¨¼«ÆäÅÓ´óµÄÈÎÎñ£©£¬·ñÔòÒÔºóËƺõÖ»ÄÜÒ»Ö±Óà Hashtable ×÷ΪӦÓóÌÐòµÄ´æ´¢¸ñʽ¡£
ÍŶӸе½ÏÝÈ뽩¾Ö£¬µ«ÕâÖ»ÊÇÒòΪËûÃDz»ÖªµÀ¹ØÓÚ Java ÐòÁл¯µÄÒ»¸öÖØÒªÊÂʵ£ºJava ÐòÁл¯ÔÊÐíËæ×Åʱ¼äµÄÍÆÒƶø¸Ä±äÀàÐÍ¡£µ±ÎÒÏòËûÃÇչʾÈçºÎ×Ô¶¯½øÐÐÐòÁл¯Ìæ»»ºó£¬ËûÃÇÖÕÓÚ°´¼Æ»®Íê³ÉÁËÏò HashMap µÄת±ä¡£
±¾ÎÄÊDZ¾ÏµÁеĵÚһƪÎÄÕ£¬Õâ¸öϵÁÐרÃŽÒʾ¹ØÓÚ Java ƽ̨µÄһЩÓÐÓõÄС֪ʶ — ÕâЩС֪ʶ²»Ò×Àí½â£¬µ«¶ÔÓÚ½â¾ö Java ±à³ÌÌôÕ½³ÙÔçÓÐÓá£
½« Java ¶ÔÏóÐòÁл¯ API ×÷Ϊ¿ª¶ËÊÇÒ»¸ö²»´íµÄÑ¡Ôñ£¬ÒòΪËü´ÓÒ»¿ªÊ¼¾Í´æÔÚÓÚ JDK 1.1 ÖС£±¾ÎĽéÉܵĹØÓÚÐòÁл¯µÄ 5 ¼þÊÂÇ齫˵·þÄúÖØÐÂÉóÊÓÄÇЩ±ê×¼ Java API¡£
Java ÐòÁл¯¼ò½é
Java ¶ÔÏóÐòÁл¯ÊÇ JDK 1.1 ÖÐÒýÈëµÄÒ»×鿪´´ÐÔÌØÐÔÖ®Ò»£¬ÓÃÓÚ×÷ΪһÖÖ½« Java ¶ÔÏóµÄ״̬ת»»Îª×Ö½ÚÊý×飬ÒÔ±ã´æ´¢»ò´«ÊäµÄ»úÖÆ£¬ÒÔºó£¬ÈÔ¿ÉÒÔ½«×Ö½ÚÊý×éת»»»Ø Java ¶ÔÏóÔÓеÄ״̬¡£
ʵ¼ÊÉÏ£¬ÐòÁл¯µÄ˼ÏëÊÇ “¶³½á” ¶ÔÏó״̬£¬´«Êä¶ÔÏó״̬£¨Ð´µ½´ÅÅÌ¡¢Í¨¹ýÍøÂç´«ÊäµÈµÈ£©£¬È»ºó “½â¶³” ״̬£¬ÖØлñµÃ¿ÉÓÃµÄ Java ¶ÔÏó¡£ËùÓÐÕâЩÊÂÇéµÄ·¢ÉúÓеãÏñÊÇħÊõ£¬ÕâÒª¹é¹¦ÓÚ ObjectInputStream/ObjectOutputStream Àà¡¢ÍêÈ«±£ÕæµÄÔªÊý¾ÝÒÔ¼°³ÌÐòÔ±Ô¸ÒâÓà Serializable ±êʶ½Ó¿Ú±ê¼ÇËûÃǵÄÀ࣬´Ó¶ø “²ÎÓë” Õâ¸ö¹ý³Ì¡£
Çåµ¥ 1 ÏÔʾһ¸öʵÏÖ Serializable µÄ Person Àà¡£
Çåµ¥ 1. Serializable Person
package com.tedneward;
public class Person
implements java.io.Serializable
{
public Person(String fn, String ln, int a)
Ïà¹ØÎĵµ£º
ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1 List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......
Õâ¸öÃÕÌâÖ®ËùÒÔ±»³ÆΪ³¤Õû³ýÊÇÒòΪËüËùÉæ¼°µÄ³ÌÐòÊÇÓйØÁ½¸ölongÐÍÊýÖµÕû³ýµÄ¡£±»³ýÊý±íʾµÄÊÇÒ»ÌìÀïµÄ΢ÃëÊý£»¶ø³ýÊý±íʾµÄÊÇÒ»ÌìÀïµÄºÁÃëÊý¡£Õâ¸ö³ÌÐò»á´òÓ¡³öʲôÄØ£¿
public class LongDivision{
public static void main(String args[]){
final long MICROS_PER_DAY = 24 * 60 * 60 * 1000 * 1000;
final lo ......
תÐͱ»ÓÃÀ´½«Ò»¸öÊýÖµ´ÓÒ»ÖÖÀàÐÍת»»µ½ÁíÒ»ÖÖÀàÐÍ¡£ÏÂÃæµÄ³ÌÐòÁ¬ÐøʹÓÃÁËÈý¸öתÐÍ¡£ÄÇôËüµ½µ×»á´òÓ¡³öʲôÄØ£¿
public class Multicast{
public static void main (String[] args){
System.out.println((int)(char)(byte) -1);
}
}
ÎÞÂÛÄãÔõÑù·ÖÎöÕâ¸ö³ÌÐò£¬¶¼»á¸Ðµ½ºÜÃÔ»ó¡£ËüÒÔintÊýÖµ-1¿ªÊ¼£¬È»ºó´ÓintתÐÍÎ ......
JSP¾Å´óÄÚÖöÔÏó£º
1.ÓëServletÓйصÄÒþº¬µÄ¶ÔÏó
(1)page page¶ÔÏó¶ÔÓ¦JavaÖеĹؼü×Öthis,Ëü´ú±íµ±Ç°JSPÒ³Ãæ
(2)config Config¶ÔÏóʹÓÃWebÈÝÆ ......