Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Java ÀíÂÛºÍʵ¼ù: Á˽ⷺÐÍ

JDK 5.0 ÖÐÔö¼ÓµÄ·ºÐÍÀàÐÍ£¬ÊÇ Java ÓïÑÔÖÐÀàÐÍ°²È«µÄÒ»´ÎÖØÒª¸Ä½ø¡£µ«ÊÇ£¬¶ÔÓÚ³õ´ÎʹÓ÷ºÐÍÀàÐ͵ÄÓû§À´Ëµ£¬·ºÐ͵ÄijЩ·½Ãæ¿´ÆðÀ´¿ÉÄܲ»ÈÝÒ×Ã÷°×£¬ÉõÖÁ·Ç³£Ææ¹Ö¡£ÔÚ±¾ÔµēJava ÀíÂÛºÍʵ¼ù”ÖУ¬Brian Goetz ·ÖÎöÁËÊø¸¿µÚÒ»´ÎʹÓ÷ºÐ͵ÄÓû§µÄ³£¼ûÏÝÚå¡£Äú¿ÉÒÔͨ¹ýÌÖÂÛÂÛ̳Óë×÷ÕߺÍÆäËû¶ÁÕß·ÖÏíÄú¶Ô±¾ÎĵĿ´·¨¡££¨Ò²¿ÉÒÔµ¥»÷±¾ÎĶ¥¶Ë»òµ×¶ËµÄÌÖÂÛÀ´·ÃÎÊÕâ¸öÂÛ̳¡££©
±íÃæÉÏ¿´ÆðÀ´£¬ÎÞÂÛÓï·¨»¹ÊÇÓ¦ÓõĻ·¾³£¨±ÈÈçÈÝÆ÷Àࣩ£¬·ºÐÍÀàÐÍ£¨»òÕß·ºÐÍ£©¶¼ÀàËÆÓÚ 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 ¶¨ÒåÖеÄÀàÐÍ°²È«³Ðŵ —— ËüÊÇÒ»¸öÕûÊýÁÐ±í£¬Õâ¾ÍÊÇ·ºÐÍÀàÐͲ»ÄÜЭ±äµÄÔ­


Ïà¹ØÎĵµ£º

Java NIO APIÏê½â

 
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......

JAVA¶¨Ê±Ö´ÐÐÈÎÎñ

Tomcat ϵĶ¨Ê±ÈÎÎñ
SysContextListener.java
package axtic.servlet;
import java.util.Timer;//¶¨Ê±Æ÷Àà
import axtic.bean.exportHistoryBean;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public class SysContextListener implements ServletContextListener
......

Java ÀíÂÛÓëʵ¼ù: ÕýȷʹÓà Volatile ±äÁ¿

Java™ ÓïÑÔ°üº¬Á½ÖÖÄÚÔÚµÄͬ²½»úÖÆ£ºÍ¬²½¿é£¨»ò·½·¨£©ºÍ volatile ±äÁ¿¡£ÕâÁ½ÖÖ»úÖƵÄÌá³ö¶¼ÊÇΪÁËʵÏÖ´úÂëÏ̵߳ݲȫÐÔ¡£ÆäÖÐ Volatile ±äÁ¿µÄͬ²½ÐԽϲµ«ÓÐʱËü¸ü¼òµ¥²¢ÇÒ¿ªÏú¸üµÍ£©£¬¶øÇÒÆäʹÓÃÒ²¸üÈÝÒ׳ö´í¡£ÔÚÕâÆÚµÄ Java ÀíÂÛÓëʵ¼ù
ÖУ¬Brian Goetz ½«½éÉܼ¸ÖÖÕýȷʹÓà volatile ±äÁ¿µÄģʽ£¬²¢Õë¶ÔÆäÊÊÓ ......

javaÖÐÈÕÆÚ¡¢ÈÕÆÚ¸ñʽ¡¢ÈÕÆÚ¼ÆËãѧϰ±Ê¼Ç

2. Calendar ¶ÔÏóµÄÈÝ´íÐÔ£¬Lenient ÉèÖà ÎÒÃÇÖªµÀÌض¨µÄÔ·ÝÓв»Í¬µÄÈÕÆÚ£¬µ±Ò»¸öÓû§¸ø³ö´íÎóµÄÈÕÆÚʱ£¬Calendar ÈçºÎ´¦ÀíµÄÄØ£¿ import java.io.*;
import java.util.*; public class WhatIsCalendar
{
    public static void main(String[] args) throws Exception{
   ......

Java Web·þÎñÖ®¡°´ÓWSDLÎĵµÖÐÉú³É¿Í»§¶ËÖ§³Ö´úÂ롱


±¾ÎĽÚÑ¡×Ô¡¶Java Web·þÎñ£º¹¹½¨ÓëÔËÐС·2.1.1½Ú
´ÓWSDLÎĵµÖÐÉú³É¿Í»§¶ËÖ§³Ö´úÂ루Generating Client-Support Code from a WSDL£©
ͨ¹ýJavaÌṩµÄ“wsimport”¹¤¾ß¿ÉÒÔºÜÈÝÒ×Íê³É»ùÓÚSOAPЭÒéµÄWeb·þÎñ¿Í»§¶ËÉú³É¹¤×÷¡£Õâ¸ö¹¤¾ß¿ÉÒÔ´Ó¶ÔÓ¦µÄWSDLÎĵµµÄ·þÎñÃèÊöÖÐÉú³É¿Í»§¶ËÖ§³Ö´úÂë»òÆäËûÏà¹Ø×ÊÔ´¡£ÊäÈë²¢Ö´ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ