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

ÈçºÎʹÓÃProxyģʽ¼°JavaÄÚ½¨µÄ¶¯Ì¬´úÀí»úÖÆ

1.Proxy
ģʽ
´úÀíģʽ֧³Ö½«Ä³Ð©²Ù×÷´Óʵ¼ÊµÄ¶ÔÏóÖзÖÀë³öÀ´£¬Í¨¹ýËüµÄ´úÀíÀàÌṩ´¦Àí¡£ÕâÑù±ãÓÚÐ޸ĺ͹ÜÀíÕâЩÌض¨µÄ²Ù×÷¡£
ÏÂÃæʾÀýÒ»¸ö´úÀíģʽµÄʵÏÖ¡£
<<interface>>Subject.java
package
com.zj.proxy;
 
public

interface
Subject {
   
void
operation1();
   
   
void
operation2(String arg);
}
ÏÖʵÀà
RealSubject.java
package
com.zj.proxy;
 
public

class
RealSubject
implements
Subject {
 
   
public

void
operation1() {
      
System.
out
.println(
"Realer do operation1"
);
   
}
 
   
public

void
operation2(String arg) {
      
System.
out
.println(
"Realer do operation2 with "
+ arg);
   
}
}
´úÀíÀà
ProxySubject.java
package
com.zj.proxy;
 
public

class
ProxySubject
implements
Subject {
   
private
Subject
proxied
;
//
±»´úÀí¶ÔÏó
 
   
public
ProxySubject(Subject
proxied) {
      
this
.
proxied
= proxied;
   
}
 
   
public

void
operation1() {
      
System.
out
.println(
"Proxyer do operation1"
);
      
proxied
.operation1();
   
}
 
   
public

void
operation2(String arg) {
      
System.
out
.println(
"Proxyer do operation2 with "
+ arg);
      
proxied
.operation2(arg);
   
}
}
²âÊÔÀà
SimpleProxyDemo.java
package
com.zj.proxy.client;
 
import
com.zj.proxy.Subject;
import
com.zj.proxy.RealSubject;
import
com.zj.proxy.ProxySubject;
 
public

class
SimpleProx


Ïà¹ØÎĵµ£º

JAVA WEBѧϰ±Ê¼Ç(ËÄ)£­Servlet¹ýÂËÆ÷

Ò»¡¢Servlet¹ýÂËÆ÷µÄ¸ÅÄ
***************************************************************************************
Servlet¹ýÂËÆ÷ÊÇÔÚJava Servlet¹æ·¶2.3Öж¨ÒåµÄ£¬ËüÄܹ»¶ÔServletÈÝÆ÷µÄÇëÇóºÍÏìÓ¦¶ÔÏó½øÐмì²éºÍÐ޸ġ£¡¡¡¡¡¡
Servlet¹ýÂËÆ÷±¾Éí²¢²»²úÉúÇëÇóºÍÏìÓ¦¶ÔÏó£¬ËüÖ»ÄÜÌṩ¹ýÂË×÷Óá£Servlet¹ýÆÚÄÜ ......

һЩ³£¼ûJavaÒì³£¹éÀà(¶þ)

ËãÊõÒì³£ÀࣺArithmeticExecption
¡¡¡¡¿ÕÖ¸ÕëÒì³£ÀࣺNullPointerException
¡¡¡¡ÀàÐÍÇ¿ÖÆת»»Òì³££ºClassCastException
¡¡¡¡Êý×鸺ϱêÒì³££ºNegativeArrayException
¡¡¡¡Êý×éϱêÔ½½çÒì³££ºArrayIndexOutOfBoundsException
¡¡¡¡Î¥±³°²È«Ô­ÔòÒì³££ºSecturityException
¡¡¡¡ÎļþÒѽáÊøÒì³££ºEOFException
¡¡¡¡ÎļþÎ´Õ ......

javaÐòÁл¯Serializable

Ä¿Ç°ÍøÂçÉϹØÓÚ¶ÔÏóÐòÁл¯µÄÎÄÕ²»ÉÙ£¬µ«ÊÇÎÒ·¢ÏÖÏêϸÐðÊöÓ÷¨ºÍÔ­ÀíµÄÎÄÕÂÌ«ÉÙ¡£±¾ÈË°Ñ×Ô¼º¾­¹ý¾­Ñé×ܽáºÍʵ¼ÊÔËÓÃÖеÄÌå»áд³ÉµÄѧϰ±Ê¼Ç¹±Ï׸ø´ó¼Ò¡£Ï£ÍûÄÜΪÕû¸öjavaÉçÇøµÄ·±ÈÙ×öÒ»µãÊÂÇé¡£
¡¡¡¡ÐòÁл¯µÄ¹ý³Ì¾ÍÊǶÔÏóдÈë×Ö½ÚÁ÷ºÍ´Ó×Ö½ÚÁ÷ÖжÁÈ¡¶ÔÏó¡£½«¶ÔÏó״̬ת»»³É×Ö½ÚÁ÷Ö®ºó£¬¿ÉÒÔÓÃjava.io°üÖеĸ÷ÖÖ×Ö½ÚÁ÷Àà½«Æ ......

JavaÓëC++

1¡¢Java²ÉÓÃUnicode×Ö·û¼¯£¬Ôö¼ÓÁ˶ԷÇÀ­¶¡ÓïϵµÄÖ§³Ö£¬Ò»¸öºº×Ö¿ÉÒÔÖ±½Ó×÷Ϊһ¸ö×Ö·û³£Á¿½øÐи³Öµ¶øÔÚC++ÖбØÐë×öΪ×Ö·û´®´¦Àí
  char chTemp = 'ÎÒ';
  System.out.println(chTemp);
Java×Ö·ûÊÇÒ»¸ö16ΪµÄÎÞ·ûºÅÕûÊý£¬C++ÖÐΪ8λ
2. Java±êʶ·û¿ÉÒÔÒÔÃÀÔª·û$¿ªÍ·£¬¿Éº¬ÓÐËùÓÐÊ®Áù½øÖÆÖµ´óÓÚ0xc0µ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ