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

java¼Ì³ÐÎÊÌâ ¾­³£Óöµ½±£´æÏÂÀ´

import java.util.ArrayList;
import java.util.HashMap;

public class Client {

/**
* @param args
*/
public static void main(String[] args) {
test1();
System.out.println("==================================");
test2();
}

public static void test1(){
ParentObj po = new ParentObj();
ArrayList list = new ArrayList();
po.doWork(list);

po = new ChildObj();
po.doWork(list);

ChildObj co = new ChildObj();
co.doWork(list);

}

public static void test2(){
ParentObj po = new ParentObj();
HashMap map = new HashMap();
po.doSport(map);

po = new ChildObj();
po.doSport(map);

ChildObj co = new ChildObj();
co.doSport(map);
}
}

import java.util.ArrayList;
import java.util.Map;

public class ParentObj {
public void doWork(ArrayList list) {
System.out.println("ParentObj doWork...");
}

public void doSport(Map map) {
System.out.println("ParentObj doSport...");
}
}
import java.util.HashMap;
import java.util.List;

public class ChildObj extends ParentObj {

public void doWork(List list) {
System.out.println("ChildObj doWork...");
}

public void doSport(HashMap map) {
System.out.println("ChildObj doSport...");
}

}
ÔËÐнá¹û:
ParentObj doWork...
ParentObj doWork...
ParentObj doWork...
==================================
ParentObj doSport...
ParentObj doSport...
ChildObj doSport...


Ïà¹ØÎĵµ£º

Thinking in Java Ö®String ÕýÔò±í´ïʽ

       Ê²Ã´ÊÇÕýÔò±í´ïʽ£¿
       ÕýÔò±í´ïʽÊÇÒ»ÖÖÇ¿´ó¶øÁé»îµÄÎı¾´¦Àí¹¤¾ß¡£Ê¹ÓÃÕýÔò±í´ïʽ£¬ÎÒÃÇÄܹ»ÒÔ±à³ÌµÄ·½Ê½£¬¹¹Ô츴ÔÓµÄÎı¾Ä£Ê½£¬²¢¶ÔÊäÈëµÄ×Ö·û´®½øÐÐËÑË÷¡£Ò»µ©ÕÒµ½ÁËÆ¥ÅäÕâЩģʽµÄ²¿·Ö£¬Äã¾ÍÄܹ»ËæÐÄËùÓûµØ¶ÔËüÃǽøÐд¦Àí¡£ÕýÔò±í´ïÊ½Ì ......

Java µ÷Óà .Net Web Service ÎÊÌâ½â¾ö·½·¨·ÖÏí

Óкܳ¤Ò»¶Îʱ¼äûÓÐд²©¿ÍÁË¡£×î½üÒ»Ä꣬ÊÕµ½²»ÉÙ½»Á÷Óʼþ¶¼ÊǹØÓÚwebservice£¬´ó²¿·Ö¶¼ÊÇËØÒªwebserviceʵÀý¡£
Æäʵ¶Ôwebservice Á˽ⲻÊǺÜÉֻÊǸù¾Ý¹¤×÷ÐèҪȥ½Ó´¥£¬È¥Ñ§Ï°¡£×î½üÏîÄ¿ºÍÆäËûÒ»¸ö.netÏîÄ¿ÐèÒª×öÊý¾Ý½»»¥£¬½»»¥·½Ê½¾Í²ÉÓÃWebservice.
Ìؽ«¿ª·¢ÖÐÓöµ½µÄÎÊÌâ×ܽᲢ·ÖÏí£»
¿ª·¢ÖÐÓöµ½µÄÎÊÌâÓУº
1£©jav ......

javaµÄvolatileÊÇʲôÒâ˼


ÎÒÃÇÖªµÀ£¬ÔÚJavaÖÐÉèÖñäÁ¿ÖµµÄ²Ù×÷£¬³ýÁËlongºÍdoubleÀàÐ͵ıäÁ¿ÍⶼÊÇÔ­×Ó²Ù×÷£¬Ò²¾ÍÊÇ˵£¬¶ÔÓÚ±äÁ¿ÖµµÄ¼òµ¥¶Áд²Ù×÷ûÓбØÒª½øÐÐͬ²½¡£
ÕâÔÚJVM 1.2֮ǰ£¬JavaµÄÄÚ´æÄ£ÐÍʵÏÖ×ÜÊÇ´ÓÖ÷´æ¶ÁÈ¡±äÁ¿£¬ÊDz»ÐèÒª½øÐÐÌرðµÄ×¢ÒâµÄ¡£¶øËæ×ÅJVMµÄ³ÉÊìºÍÓÅ»¯£¬ÏÖÔÚÔÚ¶àÏ̻߳·¾³ÏÂvolatile¹Ø¼ü×ÖµÄʹÓñäµÃ·Ç³£ÖØÒª¡£
ÔÚµ±Ç° ......

JavaÐòÁл¯¼òÃ÷¸ÅÒª

1. ¸ÅÄ ÐòÁл¯¾ÍÊǰѶÔÏó±ä³É¶ÔÏóÁ÷£¨È·ÇÐ˵ÊǰѶÔÏóµÄÊôÐÔдÈëÁ÷£©£¬Èç¹ûÐèÒª½ø¶ø¿ÉÒ԰ѶÔÏóÁ÷´æ³É¶þ½øÖÆÎļþ£»
2. Ä¿µÄ£º ÐòÁл¯µÄÄ¿µÄÊÇΪÁË·½±ãÓÀ¾Ã´æ´¢»òÕßÍøÂç´«Ê䣻
3. ÈçºÎʵÏÖ£º ½«ÀàʵÏÖSerializable½Ó¿Ú¼´¿É£¬ÎÞ±ØÐëʵÏֵķ½·¨£¬ÊµÏָýӿÚÖ»ÊÇΪÁ˱êʶ¸ÃÀà¿É±»ÐòÁл¯£»
4. £¨×ª£©ÆäËûÐèÒªÖªµÀµÄ£º
  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ