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

java·ºÐÍ ×ªÔØ


Ó¢ÎÄÔ­ÎĵØÖ·:
http://www.onjava.com/pub/a/onjava/2005/07/06/generics.html
ÖÐÎĵØÖ·:
http://www.matrix.org.cn/resource/article/43/43634_java_generics.html
¹Ø¼ü´Ê£º java generics java5
ÕªÒª
       ·ºÐÍÊÇJ2SE 5.0×îÖØÒªµÄÌØÐÔ¡£ËûÃÇÈÃÄãдһ¸ötype(Àà»ò½Ó¿Ú£©ºÍ´´½¨Ò»¸öʵÀýͨ¹ý´«µÝÒ»¸ö»ò¶à¸öÒýÓÃÀàÐÍ¡£Õâ¸öʵÀýÊÜÏÞÓÚÖ»ÄÜ×÷ÓÃÓÚÕâЩÀàÐÍ¡£±ÈÈ磬ÔÚjava 5£¬java.util.List ÒѾ­±»·º»¯¡£µ±½¨Á¢Ò»¸ölist¶ÔÏóʱ£¬Äãͨ¹ý´«µÝÒ»¸öjavaÀàÐͽ¨Á¢Ò»¸öListʵÀý£¬´ËlistʵÀýÖ»ÄÜ×÷ÓÃÓÚËù´«µÝµÄÀàÐÍ¡£ÕâÒâζ×ÅÈç¹ûÄã´«µÝÒ»¸öString ,´ËListʵÀýÖ»ÄÜÓµÓÐString¶ÔÏó£»Èç¹ûÄã´«µÝÒ»¸öInteger£¬´ËʵÀýÖ»ÄÜ´æÖüInteger¶ÔÏó¡£³ýÁË´´½¨²ÎÊý»¯µÄÀàÐÍ£¬Ä㻹ÄÜ´´½¨²ÎÊý»¯µÄº¯Êý¡£
     ·ºÐ͵ĵÚÒ»¸öºÃ´¦ÊDZàÒëʱµÄÑϸñÀàÐͼì²é¡£ÕâÊǼ¯ºÏ¿ò¼Ü×îÖØÒªµÄÌص㡣´ËÍâ,·ºÐÍÏû³ýÁ˾ø´ó¶àÊýµÄÀàÐÍת»»¡£ÔÚJDK 5.0֮ǰ£¬µ±ÄãʹÓü¯ºÏ¿ò¼Üʱ£¬Äã²»µÃ²»½øÐÐÀàÐÍת»»¡£
     ±¾ÎĽ«½ÌÄãÈçºÎ²Ù×÷·ºÐÍ¡£ËüµÄµÚÒ»²¿·ÖÊǓûÓзºÐ͵ÄÈÕ×Ó”£¬ÏÈÈÃÎÒÃÇ»ØÒäÀÏ°æ±¾JDKµÄ²»±ã¡£È»ºó£¬¾ÙһЩ·ºÐ͵ÄÀý×Ó¡£ÔÚÌÖÂÛÍêÓï·¨ÒÔ¼°Óн緺Ð͵ÄʹÓÃÖ®ºó£¬ÎÄÕÂ×îºóÒ»Õ½«½âÊÍÈçºÎд·ºÐÍ¡£
  
ûÓзºÐ͵ÄÈÕ×Ó
     ËùÓеÄjavaÀ඼Դ×Ôjava.lang.Object,ÕâÒâζ×ÅËùÓеÄJAVA¶ÔÏóÄÜת»»³ÉObject¡£Òò´Ë£¬ÔÚ֮ǰµÄJDKµÄ°æ±¾ÖУ¬ºÜ¶à¼¯ºÏ¿ò¼ÜµÄº¯Êý½ÓÊÜÒ»¸öObject²ÎÊý¡£ËùÒÔ£¬collectionsÊÇÒ»¸öÄܳÖÓÐÈκζÔÏóµÄ¶àÓÃ;¹¤¾ß£¬µ«´øÀ´Á˲»Á¼µÄºó¹û¡£
     ¾Ù¸ö¼òµ¥µÄÀý×Ó£¬ÔÚJDK 5.0µÄ֮ǰ°æ±¾ÖУ¬ÀàListµÄº¯Êýadd½ÓÊÜÒ»¸öObject²ÎÊý£º
public boolean add(java.lang.Object element)
        ËùÒÔÄãÄÜ´«µÝÈκÎÀàÐ͸øadd¡£ÕâÊǹÊÒâÕâôÉè¼ÆµÄ¡£·ñÔò£¬ËüÖ»ÄÜ´«µÝijÖÖÌض¨µÄ¶ÔÏó£¬ÕâÑù¾Í»á³öÏÖ¸÷ÖÖListÀàÐÍ£¬È磬StringList, EmployeeList, AddressListµÈ¡£
     addͨ¹ýObject´«µÝÄÜ´øÀ´ºÃ´¦,ÏÖÔÚÎÒÃÇ¿¼ÂÇgetº¯Êý(·µ»ØListÖеÄÒ»¸öÔªËØ).ÈçÏÂÊÇJDK 5֮ǰ°æ±¾µÄ¶¨Ò壺
public java.lang.Object get(int index) throws IndexOutOfBoundsException
get·µ»ØÒ»¸öObject.²»ÐÒµÄÊÂÇé´Ó´Ë¿ªÊ¼ÁË.¼ÙÈçÄã´¢´æÁËÁ½¸öString¶ÔÏóÔÚÒ»¸öListÖÐ:
List stringList1 = new ArrayList();
stringList1


Ïà¹ØÎĵµ£º

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

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

ÓÃJava´úÂë²é¿´ÏµÍ³Ä¬ÈÏ×Ö·û¼¯±àÂë

public class EchoDefaultSystemEncoding
{
    public static void main(String[] args)
    {
           String encoding = System.getProperty("file.encoding");
           System ......

C#ÓëJAVAµÄ±È½Ï

ºÜ¶àÈË˵C#ÊÇ΢ÈíÓÃÀ´ºÍJava¿¹ºâµÄÎäÆ÷£¬ÒòΪ¶þÕßÔںܴó³Ì¶ÈÉÏÓÐמªÈ˵ÄÏàËÆ£¬¾¡¹ÜÈç´Ë£¬Á½Õß²»Í¬µÄµØ·½Ò²ºÜ¶à£¬Ëùν“ÓÚϸ΢´¦¼û²îÒ씡£ÄÇôÁ½ÕßµÄÏàËƺÍÇø±ð¶¼ÔÚʲôµØ·½ÄØ£¿ÎÒÃÇ´Ó½ñÌ쿪ʼ£¬»á´Ó¸÷¸ö½Ç¶ÈÀ´¶Ô±ÈC#ºÍJavaµÄÌص㣬ϣÍûÄܶÔÕýÔÚѧϰ¡¢Ê¹ÓÃC#µÄÅóÓÑÓÐËù°ïÖú¡£
& Y0 f! I! a4 a1 K
% B# G8 ......

JavaÐéÄâ»úÄÚ´æµ÷Õû

JavaÐéÄâ»úĬÈÏ·ÖÅä64MÄڴ棬Èç¹ûÄãµÄÓ¦ÓñȽϴ󣬳¬³ö64MÄڴ棬JavaÐéÄâ»ú¾Í»áÅ׳öOutOfMemoryError£¬²¢Í£Ö¹ÔËÐС£²»¹ÜÊÇʲôӦÓã¨WebÓ¦Óá¢ApplicationµÈ£©£¬Ö»ÐèÒªÐÞ¸ÄÄãµÄ»úÆ÷ÉϵÄÔËÐÐJavaÃüÁÔÚjava xxxÃüÁîÖÐÌí¼Ó-Xms(×îСʹÓÃÄÚ´æ)¡¢-Xmx£¨×î´óʹÓÃÄڴ棩¼´¿É½â¾ö¡£µ±È»£¬Õâ¶ùµÄÄÚ´æÈÝÁ¿¶¼ÊÇÖ¸ÎïÀíÄڴ棬²»Ä ......

JAVA Öн«×Ö·û´®×ª»»³ÉÀàʵÀý¶ÔÏó

ÔںܶàʱºòÎÒÃÇÐèÒª½«Ò»¸ö¸øÁËÍêÕû·¾¶µÄÀà¶ÔÏó×Ö·û´®×ª»»³ÉÒ»¸öÀàµÄʵÀý¶ÔÏ󣬾ͱÈÈç˵ÓÐÒÔÏÂÕâÑùµÄÒ»¸ö×Ö·û´®
String  menAction= "gef.putin.step.ui.SystemMenuTest(xiajiaji)"ÔÚ¸ÃÀàÖÐÐèÒªÓÐÓÐÒ»¸ö×Ö·û´®¸ñʽµÄ²ÎÊý£¬µ±È»¶à¸ö²ÎÊýÒ²¿ÉÒÔ£¬ÎÒÒѾ­½«¶à¸ö²ÎÊýµÄ¿¼ÂǽøÈ¥£¬¶Ô¸Ä×Ö·û´®½øÐнâÎö¾Í¿ÉÒÔת»»³ÉÀàµÄʵÀý¶Ô ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ