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

JAVA ÀíÂÛ×ܽá

Ò».±àд¹¹ÔìÆ÷µÄÓÐЧ׼Ôò£º       Óþ¡¿ÉÄܼòµ¥µÄ·½·¨Ê¹¶ÔÏó½øÈëÕý³£×´Ì¬£¬Èç¹û¿ÉÒԵĻ°£¬±ÜÃâµ÷ÓÃÆäËû·½·¨¡£ÔÚ¹¹ÔìÆ÷ÄÚΨһÄܹ»°²È«µ÷ÓõÄÄÇЩ·½·¨ÊÇ»ùÀàÖеÄfinal·½·¨£¨Ò²ÊÊÓÃÓÚprivate·½·¨£¬ËüÃÇ×Ô¶¯ÊôÓÚfinal·½·¨£©¡£ ¶þ.Óü̳нøÐÐÉè¼ÆµÄ×¼Ôò£º     Óü̳бí´ïÐÐΪ¼äµÄ²îÒ죬²¢ÓÃ×ֶαí´ï״̬Éϵı仯¡£ 1: class Actor {// ÄÐÑÝÔ±
2: public void act() {}
3: }
4:  
5: class HappyActor extends Actor{//¸ßÐ˵ÄÄÐÑÝÔ±
6: public void act() {System.out.println("HappyActor");}
7: }
8:  
9: class SadActor extends Actor{//±¯É˵ÄÄÐÑÝÔ±
10: @Override
11: public void act() {System.out.println("SadActor");}
12: }
13:  
14: class Stage {//Îę̀
15: private Actor actor = new HappyActor();
16: public void change(){actor= new SadActor();}
17: public void PerformPlay(){actor.act();}
18: }
19: public class Transmogrify {
20:  
21: /**
22: * Stage¶ÔÏó°üº¬Ò»¸öActor µÄÒýÓ㬶øActor±»³õʼ»¯ÎªHappyActor¶ÔÏó£¬
23: * ÕâÒâζ×ÅPerformPlay()»á²úÉúijÖÖÌØÊâÐÐΪ¡£
24: * ¼ÈÈ»ÒýÓÃÔÚÔËÐÐʱ¿ÉÒÔÓëÁíÒ»¸ö²»Í¬µÄ¶ÔÏóÖØаó¶¨ÆðÀ´£¬
25: * ËùÒÔSadActor¶ÔÏóµÄÒýÓÿÉÒÔÔÚActorÖб»Ìæ´ú£¬È»ºóÓÉPerformPlay()²úÉúµÄÐÐΪҲËæÖ®¸Ä±ä¡£
26: * ÕâÑùÒ»À´£¬ÎÒÃÇÔÚÔËÐÐÆÚ¼ä»ñµÃÁ˶¯Ì¬µÄÁé»îÐÔ£¨ÕâÒ²³Æ×÷"״̬ģʽ"£©
27: * @param args
28: */
29: public static void main(String[] args) {
30: Stage stage = new Stage();
31: stage.PerformPlay();
32: stage.change();
33: stage.PerformPlay();
34: }
35:
36: }/*Output:
37: HappyActor
38: SadActor*///:~
39:


Ïà¹ØÎĵµ£º

JavaÉè¼Æģʽ֮:IteratorÁ´±íģʽ

ÏÈÀ´Á˽âÒ»ÏÂÁ´±íģʽµÄÔ­Àí£º
Ê×ÏÈдһ¸öJavaBean£¬ÄÚÈÝÊÇÒªÌí¼ÓµÄÔªËغ͸ÃÔªËصĽڵ㡣
public class NodeBean implements Serializable
{
   
    private Object data; //ÔªËر¾Éí
    private NodeBean next; //ÏÂÒ»¸ö½Úµã
   
  &n ......

JAVA±à³Ì˼Ï루ÖÐÎİ棩


“Éϵ۸³ÓèÈËÀà˵»°µÄÄÜÁ¦£¬¶øÑÔÓïÓÖ´´ÔìÁË˼Ï룬˼ÏëÊÇÈËÀà¶ÔÓîÖæµÄÁ¿¶È¡£”
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡——Õª×Ô¡¶Prometheus Unbound¡·£¬Shelley
? ÈËÀà……¼«ÆäÊÜÄÇЩÒѾ­³ÉΪÉç»á±í´ï¹¤¾ßµÄÌض¨ÓïÑÔµÄÖ§Åä¡£ÏëÏñһϣ¬Èç¹ûÒ»¸öÈË¿ÉÒÔ²»Ê¹ÓÃÓïÑÔ¾ÍÄܹ»´Ó±¾ÖÊÉÏÊÊÓ¦ÏÖÊµÊ ......

JAVAµÄÈÝÆ÷ List,Map,Set

JAVAµÄÈÝÆ÷---List,Map,Set
Collection
©ÀList
©¦©ÀLinkedList
©¦©ÀArrayList
©¦©¸Vector
©¦¡¡©¸Stack
©¸Set
Map
©ÀHashtable
©ÀHashMap
©¸WeakHashMap
Collection½Ó¿Ú
¡¡¡¡CollectionÊÇ×î»ù±¾µÄ¼¯ºÏ½Ó¿Ú£¬Ò»¸öCollection´ú±íÒ»×éObject£¬¼´CollectionµÄÔªËØ£¨Elements£©¡£Ò»Ð© CollectionÔÊÐíÏà ......

eclipse ÖÐ ¿ª·¢ java + flex ʱ ±¨ÕÒ²»µ½ flex µÄsdk

ÔÚeclipseÖÐн¨ÁËÒ»¸öwebÏîÄ¿ È»ºóÔÚwebÏîÄ¿ÖÐÏëÌí¼Óflex ¿ª·¢Ç°Ì¨¡£ÔÚwebÏîÄ¿ÃûÉϵã»÷ÓÒ¼ü ----flex project Nature  -----  Add flex project Nature    ÔÚµ¯³öµÄ¶Ô»°¿òÖÐ ÉèÖÃÈçͼ£º
È»ºó µã»÷ next
Flex WAR file £º  Ñ¡Ôñ ÄãµÄblazeds µÄ·¾¶ È»ºóµã»÷ Finish
½á¹û ÏîÄ¿ÏÔʾº ......

¡¾JavaÍøÂç±à³ÌÒ»¡¿Ò»¸ö¼òµ¥µÄc/s³ÌÐò

ʵÑéÒªÇó£º
1.±àд»ùÓÚTCPЭÒéµÄͨÐųÌÐò£¬°üÀ¨ServerÓëClientÁ½¸ö²¿·Ö¡£ÊµÏÖ»ØÉù³ÌÐò£º¼´¿Í»§¶Ë·¢ËÍÏûÏ¢£¬·þÎñÆ÷¶Ë½«ÊÕµ½µÄÏûÏ¢Ô­Ñù»áË͸ø¿Í»§¶Ë¡£
2.ÔÚµ¥»úÉÏÔËÐÐËüÃÇ£¬ÑéÖ¤ÆäͨÐŽá¹û£»
3.ÔÚ¶à»úÉÏÔËÐÐËüÃÇ£¬ÑéÖ¤ÆäͨÐŽá¹û£»£¨ChatServerÖ»ÐèÔËÐÐÔÚһ̨Ö÷»úÉÏ£¬ChatClient¿ÉÔÚÆäËüÖ÷»úÉÏÔËÐУ¨ÒªÖªµÀChatServerËùÔ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ