¹ØÓÚ 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)
Ïà¹ØÎĵµ£º
Ç뿼ÂÇÏÂÃæÕâ¶Î»°ËùÃèÊöµÄÎÊÌ⣺
TomÔÚÒ»¼ÒÆû³µÅä¼þÉ̵깺ÂòÁËÒ»¸ö¼ÛÖµ$1.10µÄ»ð»¨Èû£¬µ«ÊÇËûÇ®°üÖж¼ÊÇÁ½ÃÀÔªÒ»Õŵij®Æ±¡£Èç¹ûËûÓÃÒ»ÕÅÁ½ÃÀÔªµÄ³®Æ±Ö§¸¶Õâ¸ö»ð»¨Èû£¬ÄÇôӦ¸ÃÕÒ¸øËû¶àÉÙÁãÇ®ÄØ£¿
ÏÂÃæÊÇÒ»¸öÊÔͼ½â¾öÉÏÊöÎÊÌâµÄ³ÌÐò£¬Ëü»á´òÓ¡³öʲôÄØ£¿
public class Change{
public static void main(String args[ ......
Ê×ÏÈ£¬Ïë±È½ÏÒ»ÏÂÕâÁ½ÕߵIJ»Í¬¡£URLÓÃÓÚÍøÂ磬ËùÒÔ´øÓÐÃ÷ÏÔµÄprotocol£¬¶øÇÒ¶ÔÓÚÖÐÎļ°·ûºÅÖ§³ÖµÄºÜ²»ºÃ¡£File¾ÍÊÇÎÒÃÇƽ³£ÏµÍ³ÖеÄÎļþ·¾¶ÁË£¬¶ÔÓÚÖÐÎļ°·ûºÅ¶¼Ö§³Ö£¬µ«ÊÇÒѾûÓÐprotocolÁË¡£ËùÒÔ£¬ËäÈ»Á½Õ߶¼¿ÉÒÔ±íʾÎļþ·¾¶£¬µ«ÊÇÈ´²»ÄÜ»ìÓÃÁË¡£
µäÐ͵ÄURLºÍFile·¾¶µÄ±È½Ï£º
URL£ºfile:/D:/my%20java/URL&FILE ......
µÃÀ²£¬Ç°ÃæÄǸöÃÕÌâÊÇÓе㼬ÊÖ£¬µ«ËüÊÇÓйØÕû³ýµÄ£¬Ã¿¸öÈ˶¼ÖªµÀÕû³ýÊǺÜÂé·³µÄ¡£ÄÇôÏÂÃæµÄ³ÌÐòÖ»Éæ¼°¼Ó·¨£¬ËüÓÖ»á´òÓ¡³öʲôÄØ£¿
public class Elementary{
public static void main(String[] args){
System.out.println(12345+5432l);
}
}
´Ó±íÃæÉÏ¿´£¬ÕâÏñÊÇÒ»¸öºÜ¼òµ¥µÄÃÕÌâ——¼òµ¥µ½²»ÐèÒªÖ½ºÍ ......
JSP¾Å´óÄÚÖöÔÏó£º
1.ÓëServletÓйصÄÒþº¬µÄ¶ÔÏó
(1)page page¶ÔÏó¶ÔÓ¦JavaÖеĹؼü×Öthis,Ëü´ú±íµ±Ç°JSPÒ³Ãæ
(2)config Config¶ÔÏóʹÓÃWebÈÝÆ ......
1¡¢´´½¨ÁËÒ»¸ö¶ÔÏóºó£º £¨1£©Ã»ÓÐÔÚÊʵ±µÄµØ·½Êͷŵô £¨2£©ÔÚÓ¦¸ÃÊͷŵĵط½Ã»ÓÐ×öÊͷŲÙ×÷ ÀýÈ磺ÏÂÃæÒ»¶Î³ÌÐò£º m_progressDlg = ProgressDialog.show(this, getString(R.string.market),getString(R.string.is_visiting), true);
new Thread() {
public void run() {
......