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

Java Ö®´úÀíģʽ

 ´úÀíģʽ
´úÀíģʽµÄ×÷ÓÃ: ΪÆäËû¶ÔÏóÌṩһÖÖ´úÀíÒÔ¿ØÖƶÔÕâ¸ö¶ÔÏóµÄ·ÃÎÊ£¬ÔÚijЩÇé¿öÏ£¬Ò»¸ö¿Í»§²»Ïë»òÕß²»ÄÜÖ±½ÓÒýÓÃÁíÒ»¸ö¶ÔÏó£¬
¶ø´úÀí¶ÔÏó¿ÉÒÔÔÚ¿Í»§¶ËºÍÄ¿±ê¶ÔÏóÖ®¼äÆðµ½ ÖÐ½é µÄ×÷ÓÃ
¾ÙÒ»¸öÀý×Ó: ijһ¸öÈËÏëÇëÒ»¸ö¾Ö³¤ÎªËû°ìһЩÊÂÇé,Õâ¸öÈË¿ÉÄܲ»ÄÜÖ±½ÓÈ¥Õâ¸ö¾Ö³¤£¬ÒòΪ¾Ö³¤²»ÈÏʶËû£¬¼´Ê¹¿Í»§¸øËûËÍÀñ»òһЩǮ£¬¾Ö³¤Ò²²»»áÊÕ,ÕâʱºòÔõô°ì£¿¿Í»§¿ÉÒÔÏÈÈ¥ÕÒ¾Ö³¤µÄÃØÊé»òÉí±ßºìÈË£¬¾Ö³¤ÃØÊ鵱ȻÀ²£¬¸ú¾Ö³¤±È½ÏÃÜÇУ¬
Õâ¸ö¿Í»§ËûÈÏʶÕâ¸öÃØÊ飬Ëûͨ¹ýÃØÊ飬¸æËßÕâ¸öÃØÊ飬ÎÒÒªÏëÇë¾Ö³¤°ìЩʲôÊÂÇéÓÉÕâ¸öÃØÊéÈ¥Èþֳ¤È¥×öÕâ¸öÊÂÇ飬ËûÄØ£¬°ÑһЩËÍÀñ°¡£¬ÀñÆ·°¡Ë͸øÃØÊ飬ÓÉÃØÊéת½»¸ø¾Ö³¤¾Ö³¤ÊÕµ½ÃØÊé¸øËûµÄÀñÎïÖ®ºó£¬Ëû¾Í¿ÉÒÔΪÕâ¸öÈË°ìЩÊÂÇ飬ÕâʱºòÃØÊé¾ÍÏ൱ÓÚÊÇÖн顣
³éÏó½ÇÉ«£ºÏë°ìʵÄÈË 
´úÀí½ÇÉ«£ºÃØÊé 
Õæʵ½ÇÉ«£º¾Ö³¤£¬Ëû¾ßÓÐÍê³ÉËùÐèÒªµÄ¹¦ÄÜ
1.ʾÀý
Ö÷ҪʵÏÖ´úÂë,·Ö 4 ²½:
µÚÒ»²½ ³éÏó½ÇÉ«:
Subject.java
abstract public class Subject{ abstract public void request();}
µÚ¶þ²½´úÀí½ÇÉ«:
ProxySubject.java
public class ProxySubject{
 private RealSubject realSubject;  //ÒÔÕæʵ½ÇÉ«×÷Ϊ´úÀí½ÇÉ«µÄÊôÐÔ
 public ProxySubject(){}
    public void request(){  //¸Ã·½·¨·â×°ÁËÕæʵ¶ÔÏóµÄrequest·½·¨
 preRequest();
 if(realSubject == null)
 {
      realSubject = new RealSubject();
 }
 realSubject.request();   //´Ë´¦Ö´ÐÐÕæʵ¶ÔÏóµÄrequest·½·¨,Õâ¾äÌåÏÖÁË´úÀí˼Ïë
 postRequest();
 }
 private void preRequest(){
    System.out.println("hello");
}
 private void postRequest(){
    System.out.println("world");
}
   }
µÚÈý²½ Õæʵ½ÇÉ«
RealSubject.java
public class RealSubject{
        public RealSubject(){}
 public void request(){
   System.out.println("from real request");
      }
}
µÚËIJ½ ¿Í»§¶Ëµ÷ÓÃ:
Client.java
public class Client{
 public static void main(String[] args){
    Subject sub = new ProxySubject();
    sub.


Ïà¹ØÎĵµ£º

JAVAÔ´ÂëѧϰÍøÕ¾

from: http://blog.csdn.net/cool_rain_man/archive/2009/02/16/3895210.aspx
 JAVAÔ´ÂëѧϰÍøÕ¾ 
1. java2s  http://www.java2s.com/
   Õâ¸öÍøÕ¾·Ç³£ºÃ£¬·Ö³ÉÈý´óÀ࣬·Ö±ðÊÇExample¡¢Products¡¢ Articles£¬Ã¿¸ö´óÀàÏÂÓÖ·Ö±ðÉèÐí¶àСÀ࣬»¹ÓÐËÑË÷¹¦ÄÜ£¬ÕâÑù²éÕÒÆðÀ´·Ç³£·½±ã¡£¡£±ÈÈ磬Èç¹ûÒ ......

Java ¼¼ÊõÊÇʲô£¿

Java ¼¼ÊõÊÇʲô£¿
Java ¼¼Êõ¼ÈÊÇÒ»Öָ߼¶µÄÃæÏò¶ÔÏóµÄ±à³ÌÓïÑÔ£¬Ò²ÊÇÒ»¸öƽ̨¡£Java ¼¼Êõ»ùÓÚ Java ÐéÄâ»ú£¨Java virtual machine£¬JVM£©µÄ¸ÅÄî —— ÕâÊÇÓïÑÔÓëµ×²ãÈí¼þºÍÓ²¼þÖ®¼äµÄÒ»ÖÖת»»Æ÷¡£Java ÓïÑÔµÄËùÓÐʵÏÖ¶¼±ØÐëʵÏÖ JVM£¬´Ó¶øʹ Java ³ÌÐò¿ÉÒÔÔÚÓÐ JVM µÄÈκÎϵͳÉÏÔËÐС£
Java ±à³ÌÓïÑÔ£¨Java p ......

java¹¤×÷Á÷Ïê½â

 ¹¤×÷Á÷»ù±¾¸ÅÄî: ʲôÊǹ¤×÷Á÷£¿
¹¤×÷Á÷£ºÁ½¸ö»òÁ½¸öÒÔÉϵÄÈË£¬ÎªÁ˹²Í¬µÄÄ¿±ê£¬Á¬ÐøµÄÒÔ´®Ðлò²¢Ðеķ½Ê½È¥Íê³ÉijһҵÎñ¡£
ÒµÎñ£º¹¤×÷Á÷ËùÖ¸ÒµÎñº­¸ÇÁËÓë¾­ÓªÏà¹ØµÄ»î¶¯¡£
¡¡¡¡´®Ðлò²¢ÐУºÒµÎñÖеIJ½ÖèÒ²ÐíÒÔÒ»²½½Ó×ÅÒ»²½µÄ·½Ê½½øÐУ¬ÎÒÃdzÆ֮Ϊ´®ÐУ»»òÕßÓɲ»Í¬µÄÈË»ò×éºÏ¸ù¾Ý²»Í¬µÄÇé¿ö´¦Àí£¬ÎÒÃdzÆ֮Ϊ²¢ÐС ......

ÎÒµÄjavaѧϰÈÕ¼Ç

    String phoneEL="[0-9]{4}-[0-9]{6}";
    String urlEl="<a.+href*=*['\"]?.*?['\"]?.*?>";
    String emailEl="^[_a-z0-9-]+(.[_a-z0-9-]+)*"+"@[a-z0-9-]+([.][a-z0-9-]+)*$"; ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ