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

Java »ñÈ¡Á½¸öÕûÐÍÊý×éÖ®¼äµÄÖظ´ÔªËؼ¯ºÏ

    public List<Integer> findSame(int array1[], int array2[]) {
        // Öظ´ÔªËؽá¹û¼¯ºÏ
        List<Integer> result = new ArrayList<Integer>();
        // ÀûÓÃhashmapÀ´Ñ°ÕÒÖظ´ÔªËØ
        HashMap<String, String> hashMap = new HashMap<String, String>();
        // ½«µÚÒ»¸öÊý×é¼ÓÈëhashmap
        for (int i = 0; i < array1.length; i++) {
            String temp = array1[i] + "";
            hashMap.put(temp, temp);
        }
        // ±éÀúµÚ¶þ¸öÊý×é
        for (int i = 0; i < array2.length; i++) {
            String temp = array2[i] + "";
            // ÔÚÒѾ­´æÔÚµÚÒ»¸öÊý×éËùÓÐÔªËصÄhashmapÀïÑ°ÕÒµÚ¶þÊý×éÀïµÄÔªËØ
            if (hashMap.get(temp) != null) {
                // ½«Öظ´³öÏÖµÄÔªËؼÓÈë½á¹û¼¯ºÏ
                result.add(array2[i]);
            }
        }
        return result;
    }


Ïà¹ØÎĵµ£º

javaÓëSQLÊý¾Ý¿âÇŽӷ½Ê½Ò×´íÎÊÌâÓëÉè¼ÆºËÐÄ

 ÎÄÕÂÔ­´´£¬×ªÔØÇëÓëBlogÖ÷ÈËÁªÏµ£¬robin9257@hotmail.com
JAVAÓëSQLÇŽӵÄÓÅȱµã£º
1¡¢Óŵ㣺²»ÓÃÏÂÔØÇý¶¯³ÌÐò£¬ÔÊÐíÓÃÏàͬ´úÂë·ÃÎʲ»Í¬DBMS¡£
2¡¢È±µã£ºÐ§Âʵ͡£
¾­³£³öÏֵı¨´íµã£º
1¡¢java.sql.SQLException: [Microsoft][ODBC Çý¶¯³ÌÐò¹ÜÀíÆ÷] δ·¢ÏÖÊý¾ÝÔ´Ãû³Æ²¢ÇÒδָ¶¨Ä¬ÈÏÇý¶¯³ÌÐò
  
&nbs ......

javaµÄCollectionºÍMapÏê½â

 
ÏßÐÔ±í£¬Á´±í£¬¹þÏ£±íÊdz£ÓõÄÊý¾Ý½á¹¹£¬ÔÚ½øÐÐJava¿ª·¢Ê±£¬JDKÒѾ­ÎªÎÒÃÇÌṩÁËһϵÁÐÏàÓ¦µÄÀàÀ´ÊµÏÖ»ù±¾µÄÊý¾Ý½á¹¹¡£ÕâЩÀà¾ùÔÚjava.util°üÖС£±¾ÎÄÊÔͼͨ¹ý¼òµ¥µÄÃèÊö£¬Ïò¶ÁÕß²ûÊö¸÷¸öÀàµÄ×÷ÓÃÒÔ¼°ÈçºÎÕýȷʹÓÃÕâЩÀà¡£    
 
Collection  
©ÀList  
©¦©À ......

JavaÓïÑÔ(¶þ)

 ¶þ  ¶ÔÏó
    ÀàʵÀý»¯¿ÉÉú³É¶ÔÏ󣬶ÔÏóͨ¹ýÏûÏ¢´«µÝÀ´½øÐн»»¥¡£ÏûÏ¢´«µÝ¼´¼¤»îÖ¸¶¨µÄij¸ö¶ÔÏóµÄ·½·¨ÒԸıäÆä״̬»òÈÃËü²úÉúÒ»¶¨µÄÐÐΪ¡£Ò»¸ö¶ÔÏóµÄÉúÃüÖÜÆÚ°üÀ¨Èý¸ö½×¶Î£ºÉú³É¡¢Ê¹ÓúÍÏû³ý¡£
   ¶ÔÏóµÄÇå³ý
¡¡¡¡ µ±²»´æÔÚ¶ÔÒ»¸ö¶ÔÏóµÄÒýÓÃʱ£¬¸Ã¶ÔÏó³ÉΪһ¸öÎÞÓöÔÏó¡£JavaµÄÀ¬»ø ......

Õë¶Ô Java ¿ª·¢ÈËÔ±µÄ Dojo ¸ÅÄî

 
Dojo ÔÚ»ùÓÚWeb µÄÓ¦ÓóÌÐòÖÐÔ½À´Ô½Êܵ½»¶Ó­¡£ºÜ¶à¿ª·¢ÈËÔ±ÊÇ Java™ ±à³Ì·½ÃæµÄÄÜÊÖ£¬µ«ÊÇÔÚ JavaScript
·½Ãæȴȱ·¦¾­Ñé¡£´ÓÇ¿ÀàÐÍ¡¢ÃæÏò¶ÔÏóµÄ±àÒëÓïÑÔתÏò¶¯Ì¬µÄ¡¢ÈõÀàÐͽű¾ÓïÑÔ£¬¿ª·¢ÈËÔ±ÐèÒª¾­Àú¸ÅÄîԾǨ´øÀ´µÄÀ§ÄÑ¡£ÕâÖÖ»ìÂÒʹ¿ª·¢ÈËÔ±ºÜÄÑÕýÈ·µØÉùÃ÷
Dojo Àà¡£±¾ÎĽ«°ïÖúÊáÀíÕâÖÖ»ìÂÒ£¬½âÊÍΪºÎ±ØÐë ......

javaÔËÐÐÓ¦ÓóÌÐò

ÔËÐÐÓ¦ÓóÌÐòÓëÔËÐÐweb³ÌÐòÔ­ÀíÊÇÒ»Öµģ¬Ö»²»¹ýwebÓ¦ÓóÌÐòÒѾ­ÔÚÆô¶¯Ê±½«³ÌÐòÔËÓõÄjar°üÉèÖõ½»·¾³±äÁ¿ÀӦÓóÌÐò¿ÉÒÔ×Ô¼ºÐ´¸öÅú´¦ÀíÀ´ÉèÖû·¾³±äÁ¿£º
java -classpath ./lib/application.jar;./lib/hibernate3.jar -Xms608m -Xmx608m com.zyj.application.StartUp
pause/exit
ÆäÖÐapplication.jarΪӦÓóÌÐòµÄjar° ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ