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

¹ØÓÚJavaµÄsingletonģʽµÄ½éÉÜ,±È½ÏÓÐÓÃ

JavaÉè¼Æģʽ֮Singletonµ¥Àýģʽƪ
java µ¥ÀýģʽµÄʵÏÖ·½Ê½
ʵÏÖ1£º
public class Singleton {    
     private static Singleton instance;
      private Singleton (){ //Ê×ÏÈÓÐÒ»¸ö˽ÓеĹ¹ÔìÆ÷
       }
     public static Singleton getInstance() {
     if(instance==null){
         instance=new Singleton ();
      }
      return instance;
     }
}
ÕâÖÖ·½Ê½ÊÇÏ̲߳»°²È«µÄ£¬Èç¹û¶à¸öÏß³Ìͬʱ·ÃÎʵĻ°¾Í¿ÉÄÜÓжà¸ö¶ÔÏó²úÉú£¬Èç¹ûÔÚget·½·¨ÖмÓͬ²½¿éµÄ»°»áÓ°ÏìÐÔÄÜ¡£
ʵÏÖ2£º
public class Singleton {
private Singleton(){
}
private static Singleton instance =new Singleton();
public static Singleton getInstance(){
return instance;
}
}
ÕâÖÖ·½Ê½ËäÈ»²»´æÔÚ°²È«ÐÔÎÊÌ⣬µ«ÊÇÔÚ³ÌÐòÆô¶¯µÄʱºò¾Í»á³õʼ»¯¡£
ʵÏÖ3£º
public class Singleton {
private static class SingletonHolder {
static Singleton instance = new Singleton();
}
public static Singleton getInstance() {
return SingletonHolder.instance;
}
}
3ÖÖ·½Ê½ÖÐÕâÊÇ×îºÃµÄ½â¾ö·½°¸£¬¼È½â¾öÁËÏß³Ìͬ²½µÄÎÊÌ⣬ÓÐÔÚµ÷ÓõÄʱºò²Å³õʼ»¯¡£
µ¥ÀýģʽÖ÷ÒªÓÐ3¸öÌص㣬£º
1¡¢µ¥ÀýÀàÈ·±£×Ô¼ºÖ»ÓÐÒ»¸öʵÀý¡£
2¡¢µ¥ÀýÀà±ØÐë×Ô¼º´´½¨×Ô¼ºµÄʵÀý¡£
3¡¢µ¥ÀýÀà±ØÐëΪÆäËû¶ÔÏóÌṩΨһµÄʵÀý¡£
ʲôʱºòʹÓõ¥Àýģʽ£¿
µ¥ÀýģʽҲÊÇÒ»ÖֱȽϳ£¼ûµÄÉè¼Æģʽ£¬Ëüµ½µ×ÄÜ´ø¸øÎÒÃÇʲôºÃ´¦ÄØ£¿ÆäʵÎÞ·ÇÊÇÈý¸ö·½ÃæµÄ×÷Óãº
µÚÒ»¡¢¿ØÖÆ×ÊÔ´µÄʹÓã¬Í¨¹ýÏß³Ìͬ²½À´¿ØÖÆ×ÊÔ´µÄ²¢·¢·ÃÎÊ£»
µÚ¶þ¡¢¿ØÖÆʵÀý²úÉúµÄÊýÁ¿£¬´ïµ½½ÚÔ¼×ÊÔ´µÄÄ¿µÄ¡£
µÚÈý¡¢×÷ΪͨÐÅý½éʹÓã¬Ò²¾ÍÊÇÊý¾Ý¹²Ïí£¬Ëü¿ÉÒÔÔÚ²»½¨Á¢Ö±½Ó¹ØÁªµÄÌõ¼þÏ£¬Èöà¸ö²»Ïà¹ØµÄÁ½¸öÏ̻߳òÕß½ø³ÌÖ®¼äʵÏÖͨÐÅ¡£
±È È磬Êý¾Ý¿âÁ¬½Ó³ØµÄÉè¼ÆÒ»°ã²ÉÓõ¥Àýģʽ£¬Êý¾Ý¿âÁ¬½ÓÊÇÒ»ÖÖÊý¾Ý¿â×ÊÔ´¡£Èí¼þϵͳÖÐʹÓÃÊý¾Ý¿âÁ¬½Ó³Ø£¬Ö÷ÒªÊǽÚÊ¡´ò¿ª»òÕ߹رÕÊý¾Ý¿âÁ¬½ÓËùÒýÆðµÄЧÂÊËð ºÄ£¬ÕâÖÖЧÂÊÉϵÄËðºÄ»¹ÊǷdz£°º¹óµÄ¡£µ±È»£¬Ê¹ÓÃÊý¾Ý¿âÁ¬½Ó³Ø»¹ÓкܶàÆäËüµÄºÃ´¦£¬¿ÉÒÔÆÁ±Î²»Í¬Êý¾ÝÊý¾Ý¿âÖ®¼äµÄ²îÒ죬ʵÏÖϵͳ¶ÔÊý¾Ý¿âµÄµÍ¶ÈñîºÏ£


Ïà¹ØÎĵµ£º

ÓÃJAVAʵÏÖÁË´øÓи´Ñ¡¿òµÄÊ÷Ŀ¼

JDK°æ±¾
        JDK1.4.x
    ¹¦ÄÜ
        ʵÏÖÁË´øÓи´Ñ¡¿òµÄ×ÊÔ´¹ÜÀíÆ÷Ê÷Ŀ¼£¬»¹ÓÐÐèÒª¸Ä½øµÄµØ·½£¬ÎÒÔÚÒÔºó¸üУ¬Èç¹ûÄÇλÅóÓÑÓкõĽ¨Ò黶ӭÌá³ö
   
    »¶Ó­´ó¼ÒÌáÒâ¼û£¬½»Á÷
  ......

×ö3G¿ª·¢ÊÇѧJava»¹ÊÇC++

ÓкܶàѧÉúÎÊÎÒ,ÏÖÔÚ 3GÒƶ¯»¥ÁªÍø·¢Õ¹Ö®ÊÆÍ·±Ø½«ÊÇITÁìÓò·¢Õ¹Ê®ÄêÒ»ÓöµÄÄѵûúÓö£¬ÏëͶÉíµ½¸ÃÐÐÒµÖУ¬²»ÖªµÀÊÇÓ¦¸ÃѧÍøÂç¡¢»¹ÊÇѧǶÈëʽÉ豸¿ª·¢¡¢»¹ÊÇѧϰһÏÂJava,C++Ó¦Óÿª·¢£¬»¹ÊÇѧϰһÏ¿ªÔ´¿ò¼ÜAndroid?
 
´ÓÎÒ¸öÈ˶ÔÐÐÒµµÄÀí½âÀ´½²£¬Òƶ¯»¥ÁªÍøµÄ·¢Õ¹Ò»¶¨ÊÇÏÈ´ÓÍøÂ翪ʼ£¬ÍøÂçÉ豸ÌṩÉÌ¡¢Ð­ÒéµÄ¿ª·¢»ú¹¹£¨ ......

´ÓC++תµ½JavaÐè×¢ÒâµÄµØ·½

 1.JavaÔÚÐéÄâ»úÉÏÔËÐÐ
JavaÔ´´úÂë²¢²»ÊDZ»±àÒë³ÉΪÆÕͨµÄ»úÆ÷´úÂë¡£¶øÊDZ»·­Òë³ÉΪÐéÄâ»ú¿ÉÒÔÖ´ÐеĴúÂë¡£Ò»¸öJava½âÊÍÆ÷×îÖÕÖ´ÐÐÕâЩ´úÂë¡£ÕâÆäÖÐûÓÐÁ¬½ÓµÄ¹ý³Ì£»½âÊÍÔÚÐèÒªµÄʱºò¶¯Ì¬µÄ¼ÓÔØһЩÀࣻ
2.JavaÊÇÍêÈ«ÃæÏò¶ÔÏóµÄ
JavaÊÇÒ»ÖÖÍêÈ«ÃæÏò¶ÔÏóµÄÓïÑÔ¡£ÕâÒâζ×ÅÄã¶ÔÈκÎÒ»¸öJava¶ÔÏóËù×öµÄ¶¯×÷¶¼ÊÇͨ¹ýÒ ......

Axis2 java WebServices¿ª·¢¶þ

¿ª·¢»·¾³  eclipse3.2 £¨Ã»ÓÐÅäÖû·¾³ Çë²Î¿´ÉÏһƪÈÕÖ¾£©
н¨ÏîÄ¿£º
UserCover£¨Ãû³ÆËæ±ã£© ×ö¸ö¼òµ¥µÄ±¨µÀ²¢¼Ç¼µ÷ÓÃserverµÄusername
н¨°ü£ºcom.axis2.test
н¨½Ó¿Ú£º
package com.axis2.test;
public interface UserCover {
public void CoverName(String myname);
public String getUserList ......

VBÓëJAVA½»»¥


Private Sub Command1_Click()
Dim dso As New XMLDSOControl
Dim doc As IXMLDOMDocument
  Set doc = dso.XMLDocument
Dim rel  As IXMLDOMNodeList
Set x = CreateObject("Microsoft.XMLHTTP")
  x.Open "GET", "http://127.0.0.1:8080/emrb/Mrbmodel?action=dis&u ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ