2009Äê9Ô³ö°æµÄ¡£Í¬ÊÇ¡¶Èí¼þ¿ª·¢¿ÎÌá·ÏµÁС£±¾ÈËÔÚ±¾ÊéÖбàдµÄÕ½ÚΪ£º
µÚ12Õ£º¶àÏß³Ì
µÚ13Õ£ºIOÁ÷
µÚ15Õ£º·´Éä
µÚ16Õ£º×¢½â
µÚ19Õ£ºÍøÂç±à³Ì
µÚ20Õ£ºÏîĿʵÀýÖ®ÍøÂç°æQQ
ͼÊé·âÃæ£º
¹ºÂòÁ´½Ó£ºhttp://www.china-pub.com/195979&ref=ps ......
dz̸Java·ºÐͱà³Ì
1 ÒýÑÔÔÚJDK 1.5ÖУ¬¼¸¸öеÄÌØÕ÷±»ÒýÈëJavaÓïÑÔ¡£ÆäÖÐÖ®Ò»¾ÍÊÇ·ºÐÍ£¨generics£©¡£·ºÐÍ£¨generics£¬genericity£©ÓÖ³ÆÎª“²ÎÊýÀàÐÍ»¯£¨parameterized type£©”»ò“Ä£°å£¨templates£©”£¬ÊǺͼ̳У¨inheritance£©²»Í¬¶ø»¥²¹µÄÒ»ÖÖ×é¼þ¸´ÓûúÖÆ¡£¼Ì³ÐºÍ·ºÐ͵IJ»Í¬Ö®´¦ÔÚÓÚ——ÔÚÒ»¸öϵͳÖУ¬¼Ì³Ð²ã´ÎÊÇ´¹Ö±·½Ïò£¬´Ó³éÏóµ½¾ßÌ壬¶ø·ºÐÍÊÇˮƽ·½ÏòÉϵġ£µ±ÔËÓü̳У¬²»Í¬µÄÀàÐͽ«ÓµÓÐÏàͬµÄ½Ó¿Ú£¬²¢»ñµÃÁ˶à̬ÐÔ£»µ±ÔËÓ÷ºÐÍ£¬½«ÓµÓÐÐí¶à²»Í¬µÄÀàÐÍ£¬²¢µÃÒÔÏàͬµÄËã·¨×÷ÓÃÔÚËüÃÇÉíÉÏ¡£Òò´Ë£¬Ò»°ã˵À´£¬µ±ÀàÐÍÓëʵÏÖ·½·¨ÎÞ¹ØÊ±£¬Ê¹Ó÷ºÐÍ£»·ñÔò£¬Óü̳С£
·ºÐͼ¼Êõ×îÖ±½ÓÁªÏëµ½µÄÓÃ;¾ÍÊǽ¨Á¢ÈÝÆ÷ÀàÐÍ¡£ÏÂÃæÊÇÒ»¸öûÓÐʹÓ÷ºÐͼ¼ÊõµÄÀý×Ó£º List myIntList = new LinkedList();// 1 myIntLikst.add(new Integer(0));// 2 Integer x = (Integer)myIntList.iterator().next();// 3 ÏÔÈ»£¬³ÌÐòÔ±ÖªµÀ¾¿¾¹ÊÇʲô¾ßÌåÀàÐͱ»·Å½øÁËmyIntListÖС£µ«ÊÇ£¬µÚ3ÐеÄÀàÐÍת»»£¨cast£©ÊDZز»¿ÉÉٵġ£ÒòΪ±àÒëÆ÷½ö½öÄܱ£Ö¤iterator·µ»ØµÄÊÇObjectÀàÐÍ¡£ÒªÏë±£Ö¤½«Õâ¸öÖµ´«¸øÒ»¸öIntegerÀàÐͱäÁ¿Êǰ²È«µÄ£¬¾Í±ØÐëÀàÐÍת»»¡£³ýÁËʹ´úÂëÏÔ ......
1.Java Ô´ÎļþÖÐ×î¶àÖ»ÄÜÓÐÒ»¸ö£¨£©À࣬ÆäËûÀàµÄ¸öÊý²»ÏÞ¡£
publicÀà,¶øÇÒÕâ¸öÀàµÄÀàÃûÒªºÍÎļþÃûÒ»ÖÂ.
2.ÃæÏò¶ÔÏó³ÌÐòÉè¼ÆµÄÌØÕ÷£¨·â×°ÐÔ£©£¨¼Ì³Ð£©£¨¶à̬ÐÔ£©
3.½Ó¿ÚÊÇÓÉ£¨³éÏó·½·¨£©ºÍ£¨³£Á¿£©×é³ÉµÄÌØÊâÀà
4.ÓÃstaticÐÞÊεķ½·¨ÊÇ£¨¾²Ì¬·½·¨£¬»òÀà·½·¨£©
5.ÔÚ²úÉúÒì³£µÄ·½·¨ÉùÃ÷ÖÐÉùÃ÷»á²úÉúµÄÒì³££¬Ïò¸ü¸ßÒ»¼¶·½·¨Å׳öÒì³£µÄ¹Ø¼ü×ÖÊÇ£ºthrows
6.×ÓÀàͨ¹ý£¨super£©¹Ø¼ü×Öµ÷Óø¸ÀàµÄ¹¹Ôì·½·¨¡£
7.JavaµÄ±ê×¼Êä³öÁ÷ÊÇ£¨System.out£©¡£
8.ʵÏּ̳еĹؼü×Ö£¨extends£©¡£
9.JVMÊÇ£¨JavaÐéÄâ»ú--java virtual machine£©
JDKÊÇ£¨java¿ª·¢¹¤¾ß°ü--Java Developer's Kit £©
appletviewerÊÇ(СӦÓóÌÐòÔÄÀÀÆ÷) ¡£
10.Óû§²»ÄÜÖ±½Óµ÷Óù¹Ôì·½·¨£¬Ö»ÄÜͨ¹ý£¨new £©¹Ø¼ü×Ö×Ô¶¯µ÷Óá£
11.ÔÚ Java ÖУ¬ÓÉJava±àÒëÆ÷×Ô¶¯µ¼È룬¶øÎÞÐèÔÚ³ÌÐòÖÐÓÃimportµ¼ÈëµÄ°üÊÇ£¨java.lang.*£©
12.ÔÚ Java ÖУ¬ÄÜʵÏÖ¶àÖØ¼Ì³ÐЧ¹ûµÄ·½Ê½ÊÇ£¨ÊµÏÖ¶à¸ö½Ó¿Ú£©
13.´´½¨°üµÄÓï¾äÓ¦¸Ã·ÅÔÚ³ÌÐòµÄλÖÃΪ£¨·Ç×¢Ê͵ĵÚÒ»ÐУ©¡£
14.Óã¨abstract£©¹Ø¼ü×ÖÐÞÊεÄÀàÖ»Äܱ»¼Ì³Ð£¬²»ÄÜÉú³ÉÆä¶ÔÏó¡£
15.ͨ¹ýµ÷ÓÃThreadÀàµÄ£¨start£© ......
javaÖÐʱ¼ä´ÁºÍʱ¼ä×Ö·û´®Ö®¼äµÄת»»
»ñÈ¡µ±Ç°µÄunixʱ¼ä´Á
new Date().getTime()
System.currentTimeMillis()
·µ»ØµÄÊǺÁÃëÊý£¬Òª×ª»»long t = System.currentTimeMillis()/1000;
»ñÈ¡µ±Ç°ÄêÔÂÈÕÒÔ¼°Ê±·ÖÃë
Calendar c = Calendar.getInstance();
c.get(Calendar.YEAR)) c.get(Calendar.YEAR)) c.get(Calendar.DATE)
½«UNIXʱ¼ä´Áת»»³Éʱ¼ä×Ö·û´®
new SimpleDateFormat("yyyy/MM/dd").format(new Date(timestamp*1000));
½«Ê±¼ä×Ö·û´®×ª»»³ÉUNIXʱ¼ä´Á
new java.text.SimpleDateFormat (”dd/MM/yyyy HH:mm:ss”).parse(”09/22/2008 16:33:00″).getTime()
ÔÚjavaÖÐ×Ö·û´®ºÍunixʱ¼ä´ÁÖ®¼äÓÐÒ»¸öÖÐרÀàÐÍÊÇDate
Date.getTime() ÓÉDateµ½unixtime
new Date(unixtime) ÓÉunixtimeµ½Date
×¢Ò⣺
Çë×¢Ò⣡¶ÔÓ벻ͬµÄÊ±Çø´¦ÀíÉÏÓвîÒ죬Ê×ÏÈÒªÇå³þ×Ô¼ºËùÔÚµÄÊ±Çø¡£
String timezone_info = System.getProperty(”user.timezone”);
System.out.println(”µ±Ç°µÄÊ±Çø:”+timezone_info);
System.out.println(”Ê±ÇøÐÅÏ¢:”+TimeZone.getDefault());
Êä³ö£º
µ±Ç°µÄ求 ......
javaÖÐʱ¼ä´ÁºÍʱ¼ä×Ö·û´®Ö®¼äµÄת»»
»ñÈ¡µ±Ç°µÄunixʱ¼ä´Á
new Date().getTime()
System.currentTimeMillis()
·µ»ØµÄÊǺÁÃëÊý£¬Òª×ª»»long t = System.currentTimeMillis()/1000;
»ñÈ¡µ±Ç°ÄêÔÂÈÕÒÔ¼°Ê±·ÖÃë
Calendar c = Calendar.getInstance();
c.get(Calendar.YEAR)) c.get(Calendar.YEAR)) c.get(Calendar.DATE)
½«UNIXʱ¼ä´Áת»»³Éʱ¼ä×Ö·û´®
new SimpleDateFormat("yyyy/MM/dd").format(new Date(timestamp*1000));
½«Ê±¼ä×Ö·û´®×ª»»³ÉUNIXʱ¼ä´Á
new java.text.SimpleDateFormat (”dd/MM/yyyy HH:mm:ss”).parse(”09/22/2008 16:33:00″).getTime()
ÔÚjavaÖÐ×Ö·û´®ºÍunixʱ¼ä´ÁÖ®¼äÓÐÒ»¸öÖÐרÀàÐÍÊÇDate
Date.getTime() ÓÉDateµ½unixtime
new Date(unixtime) ÓÉunixtimeµ½Date
×¢Ò⣺
Çë×¢Ò⣡¶ÔÓ벻ͬµÄÊ±Çø´¦ÀíÉÏÓвîÒ죬Ê×ÏÈÒªÇå³þ×Ô¼ºËùÔÚµÄÊ±Çø¡£
String timezone_info = System.getProperty(”user.timezone”);
System.out.println(”µ±Ç°µÄÊ±Çø:”+timezone_info);
System.out.println(”Ê±ÇøÐÅÏ¢:”+TimeZone.getDefault());
Êä³ö£º
µ±Ç°µÄ求 ......
javaÖÐʱ¼ä´ÁºÍʱ¼ä×Ö·û´®Ö®¼äµÄת»»
»ñÈ¡µ±Ç°µÄunixʱ¼ä´Á
new Date().getTime()
System.currentTimeMillis()
·µ»ØµÄÊǺÁÃëÊý£¬Òª×ª»»long t = System.currentTimeMillis()/1000;
»ñÈ¡µ±Ç°ÄêÔÂÈÕÒÔ¼°Ê±·ÖÃë
Calendar c = Calendar.getInstance();
c.get(Calendar.YEAR)) c.get(Calendar.YEAR)) c.get(Calendar.DATE)
½«UNIXʱ¼ä´Áת»»³Éʱ¼ä×Ö·û´®
new SimpleDateFormat("yyyy/MM/dd").format(new Date(timestamp*1000));
½«Ê±¼ä×Ö·û´®×ª»»³ÉUNIXʱ¼ä´Á
new java.text.SimpleDateFormat (”dd/MM/yyyy HH:mm:ss”).parse(”09/22/2008 16:33:00″).getTime()
ÔÚjavaÖÐ×Ö·û´®ºÍunixʱ¼ä´ÁÖ®¼äÓÐÒ»¸öÖÐרÀàÐÍÊÇDate
Date.getTime() ÓÉDateµ½unixtime
new Date(unixtime) ÓÉunixtimeµ½Date
×¢Ò⣺
Çë×¢Ò⣡¶ÔÓ벻ͬµÄÊ±Çø´¦ÀíÉÏÓвîÒ죬Ê×ÏÈÒªÇå³þ×Ô¼ºËùÔÚµÄÊ±Çø¡£
String timezone_info = System.getProperty(”user.timezone”);
System.out.println(”µ±Ç°µÄÊ±Çø:”+timezone_info);
System.out.println(”Ê±ÇøÐÅÏ¢:”+TimeZone.getDefault());
Êä³ö£º
µ±Ç°µÄ求 ......
³éÏ󻯺ͼ̳йØÏµÊ¹¸ÅÄîºÍ¶¨Òå¿ÉÒÔ¸´Óã»¶à̬ÐÔʹʵÏÖºÍÓ¦ÓÿÉÒÔ¸´Óã»
¿ª±ÕÔÔò£¨Open-Closed Principle OCP£©Ò»¸öÈí¼þʵÌåÓ¦µ±¶ÔÀ©Õ¹¿ª·Å£¬¶ÔÐ޸ķâ±Õ¡£
¶Ô¿É±äÐԵķâ×°ÔÔò£¨Principle of Encapsulation of Variation£© (1)Ò»Öֱ仯ÐÔ²»ºÍÁíÒ»ÖÖ»ìºÏÔÚÒ»Æð £¨2£©Ò»ÖֿɱäÐÔ²»Ó¦É¢ÂäÔÚ´úÂëµÄºÜ¶àµØ·½¡£
ÀïÊÏ´ú»»ÔÔò£¨Liskov Substitution Principle£©£ºÈκλùÀà³öÏֵĵط½£¬×ÓÀàÒ»¶¨¿ÉÒÔ³öÏÖ¡£
ÒÀÀµµ¹×ªÔÔò£¨Dependence Inversion£©£ºÒªÒÀÀµÓÚ³éÏ󣬲»ÒªÒÀÀµÓÚʵÏÖ¡£
×éºÏ/¾ÛºÏ¸´ÓÃÔÔò£¨ Composite/Aggregate Reuse Principle£©£º¾¡¿ÉÄÜʹÓÃ×éºÏ/¾ÛºÏ£¬¶ø²»ÊǼ̳йØÏµ¡£
µÏÃ×ÌØ·¨Ôò£ºÒ»¸öÈí¼þʵÌåÓ¦¾¡¿ÉÄÜÉÙµØºÍÆäËûÈí¼þʵÌå·¢Éú¹ØÏµ¡£
½Ó¿Ú¸ôÀëÔÔò£¨Interface Segregation Principle£©£ºÏò¿Í»§¶ËÌṩ¾¡¿ÉÄÜСµÄ¶ÀÁ¢µÄ½Ó¿Ú£¬¶ø²»ÊÇ´óµÄ×ܽӿڡ£
CoadÔÔò£¬Ê²Ã´Ê±ºòʹÓü̳и´Óã¿
£¨1£©×ÓÀàÊdz¬ÀàµÄÒ»¸öÌØÊâÖÖÀ࣬²»Êdz¬ÀàµÄÒ»¸ö½ÇÉ«£¬Çø·ÖIs-a£¬Has-a
£¨2£©×ÓÀàÀ©Õ¹³¬ÀàÖ°Ô𣬶ø²»ÊÇ»»µô¡£
£¨3£©ÓÀÔ¶²»»á³öÏÖÐèÒª½«×ÓÀà»»³ÉÁíÒ»¸öÀàµÄ×ÓÀàµÄÇé¿ö¡£
£¨4£©Ö»Ó÷ÖÀàѧÉÏÓÐÒâÒåʱ£¬²ÅʹÓü̳У¬²»Òª´Ó¹¤¾ßÀà¼Ì³Ð¡£
¼¸¸ö¹¤³§Ä£Ê½½â¾ö¶ÔÏó´´½¨¹ý³ÌÖеÄÒÀ ......
Ò»¡¢±³¾°
×î½üÒ»Äê¶àÀ´,ÔÚInternetÉϳöÏÖµÄÌØ±ðÎüÒýÈ˵Äʼþ¾ÍÊÇJavaÓïÑÔºÍÓÃJava±àдµÄä¯ÀÀÆ÷HotJava¡£
1991Äê,SUNMicroSystem¹«Ë¾µÄJameGosling¡¢BillJoeµÈÈË,ΪÔÚµçÊÓ¡¢¿ØÖÆ¿¾Ãæ°üÏäµÈ¼ÒÓÃÏû·ÑÀàµç×Ó²úÆ·ÉϽøÐн»»¥Ê½²Ù×÷¶ø¿ª·¢ÁËÒ»¸öÃûΪOakµÄÈí¼þ(¼´Ò»ÖÖÏðÊ÷µÄÃû×Ö),µ«µ±Ê±²¢Ã»ÓÐÒýÆðÈËÃǵÄ×¢Òâ,Ö±µ½1994ÄêϰëÄê,InternetµÄѸÃÍ·¢Õ¹,»·ÇòÐÅÏ¢ÍøWWWµÄ¿ìËÙÔö³¤,´Ù½øÁËJavaÓïÑÔÑÐÖÆµÄ½øÕ¹,ʹµÃËüÖð½¥³ÉΪInternetÉÏÊÜ»¶ÓµÄ¿ª·¢Óë±à³ÌÓïÑÔ,Ò»Ð©ÖøÃûµÄ¼ÆËã»ú¹«Ë¾·×·×¹ºÂòÁËJavaÓïÑÔµÄʹÓÃȨ,
ÈçMi-croSoft¡¢IBM¡¢Netscape¡¢Novell¡¢Apple¡¢DEC¡¢SGIµÈ,Òò´Ë,JavaÓïÑÔ±»ÃÀ¹úµÄÖøÃûÔÓÖ¾PCMagazineÆÀΪ1995ÄêÊ®´óÓÅÐã¿Æ¼¼²úÆ·,(¼ÆËã»úÀà¾Í´ËÒ»ÏîÈëÑ¡),ËæÖ®´óÁ¿³öÏÖÁËÓÃJava±àдµÄÈí¼þ²úÆ·,Êܵ½¹¤Òµ½çµÄÖØÊÓÓëºÃÆÀ,ÈÏΪ"JavaÊǰËÊ®Äê´úÒÔÀ´¼ÆËã»ú½çµÄÒ»¼þ´óÊÂ",
΢Èí×ܲñȶû?¸Ç´ÄÔÚÇÄÇĵع۲ìÁËÒ»¶Îʱ¼äºó,²»Î޸п®µØËµ:"JavaÊdz¤Ê±¼äÒÔÀ´×î׿ԽµÄ³ÌÐòÉè¼ÆÓïÑÔ",²¢È·¶¨Î¢ÈíÕû¸öÈí¼þ¿ª·¢µÄÕ½ÂÔ´ÓPCµ¥»úʱ´úÏò×ÅÒÔÍøÂçΪÖÐÐĵļÆËãʱ´ú×ªÒÆ,¶ø¹ºÂòJavaÔòÊÇËûµÄÖØ´óÕ½ÂÔ¾ö²ßµÄʵʩ²¿Êð¡£Òò´Ë,JavaµÄµ®Éú±Ø½«¶ÔÕû¸ö¼ÆËã»ú²úÒµ·¢ÉúÉîÔ¶µÄÓ°Ïì,¶Ô´«Í³µÄ¼ÆËãÄ£ÐÍÌá³ö ......