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;
}
Ïà¹ØÎĵµ£º
ÎÄÕÂÔ´´£¬×ªÔØÇëÓëBlogÖ÷ÈËÁªÏµ£¬robin9257@hotmail.com
JAVAÓëSQLÇŽӵÄÓÅȱµã£º
1¡¢Óŵ㣺²»ÓÃÏÂÔØÇý¶¯³ÌÐò£¬ÔÊÐíÓÃÏàͬ´úÂë·ÃÎʲ»Í¬DBMS¡£
2¡¢È±µã£ºÐ§Âʵ͡£
¾³£³öÏֵı¨´íµã£º
1¡¢java.sql.SQLException: [Microsoft][ODBC Çý¶¯³ÌÐò¹ÜÀíÆ÷] δ·¢ÏÖÊý¾ÝÔ´Ãû³Æ²¢ÇÒδָ¶¨Ä¬ÈÏÇý¶¯³ÌÐò
&nbs ......
ÏßÐÔ±í£¬Á´±í£¬¹þÏ£±íÊdz£ÓõÄÊý¾Ý½á¹¹£¬ÔÚ½øÐÐJava¿ª·¢Ê±£¬JDKÒѾΪÎÒÃÇÌṩÁËһϵÁÐÏàÓ¦µÄÀàÀ´ÊµÏÖ»ù±¾µÄÊý¾Ý½á¹¹¡£ÕâЩÀà¾ùÔÚjava.util°üÖС£±¾ÎÄÊÔͼͨ¹ý¼òµ¥µÄÃèÊö£¬Ïò¶ÁÕß²ûÊö¸÷¸öÀàµÄ×÷ÓÃÒÔ¼°ÈçºÎÕýȷʹÓÃÕâЩÀà¡£
Collection
©ÀList
©¦©À ......
¶þ ¶ÔÏó
ÀàʵÀý»¯¿ÉÉú³É¶ÔÏ󣬶ÔÏóͨ¹ýÏûÏ¢´«µÝÀ´½øÐн»»¥¡£ÏûÏ¢´«µÝ¼´¼¤»îÖ¸¶¨µÄij¸ö¶ÔÏóµÄ·½·¨ÒԸıäÆä״̬»òÈÃËü²úÉúÒ»¶¨µÄÐÐΪ¡£Ò»¸ö¶ÔÏóµÄÉúÃüÖÜÆÚ°üÀ¨Èý¸ö½×¶Î£ºÉú³É¡¢Ê¹ÓúÍÏû³ý¡£
¶ÔÏóµÄÇå³ý
¡¡¡¡ µ±²»´æÔÚ¶ÔÒ»¸ö¶ÔÏóµÄÒýÓÃʱ£¬¸Ã¶ÔÏó³ÉΪһ¸öÎÞÓöÔÏó¡£JavaµÄÀ¬»ø ......
Dojo ÔÚ»ùÓÚWeb µÄÓ¦ÓóÌÐòÖÐÔ½À´Ô½Êܵ½»¶Ó¡£ºÜ¶à¿ª·¢ÈËÔ±ÊÇ Java™ ±à³Ì·½ÃæµÄÄÜÊÖ£¬µ«ÊÇÔÚ JavaScript
·½Ãæȴȱ·¦¾Ñé¡£´ÓÇ¿ÀàÐÍ¡¢ÃæÏò¶ÔÏóµÄ±àÒëÓïÑÔתÏò¶¯Ì¬µÄ¡¢ÈõÀàÐͽű¾ÓïÑÔ£¬¿ª·¢ÈËÔ±ÐèÒª¾Àú¸ÅÄîԾǨ´øÀ´µÄÀ§ÄÑ¡£ÕâÖÖ»ìÂÒʹ¿ª·¢ÈËÔ±ºÜÄÑÕýÈ·µØÉùÃ÷
Dojo Àà¡£±¾ÎĽ«°ïÖúÊáÀíÕâÖÖ»ìÂÒ£¬½âÊÍΪºÎ±ØÐë ......
ÔËÐÐÓ¦ÓóÌÐòÓëÔËÐÐweb³ÌÐòÔÀíÊÇÒ»Öµģ¬Ö»²»¹ýwebÓ¦ÓóÌÐòÒѾÔÚÆô¶¯Ê±½«³ÌÐòÔËÓõÄjar°üÉèÖõ½»·¾³±äÁ¿ÀӦÓóÌÐò¿ÉÒÔ×Ô¼ºÐ´¸öÅú´¦ÀíÀ´ÉèÖû·¾³±äÁ¿£º
java -classpath ./lib/application.jar;./lib/hibernate3.jar -Xms608m -Xmx608m com.zyj.application.StartUp
pause/exit
ÆäÖÐapplication.jarΪӦÓóÌÐòµÄjar° ......