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

JAVAðÅÝÅÅÐòËã·¨µÄ¼¸ÖÖʵÏÖ·½·¨

±¾Îijö×Ô “ÌÆ´óÀÏʦ” ²©¿Í£¬ÇëÎñ±Ø±£Áô´Ë³ö´¦http://tscjsj.blog.51cto.com/412451/84561
public class Bubble {
// ðÅÝÅÅÐòº¯Êý1
public static void bubbleSort1(Comparable []data){

int position,scan;
Comparable temp;
for(position = data.length-1;position>=0;position--){
for(scan=0;scan<=position-1;scan++){
if(data[scan].compareTo(data[scan+1])<0){
temp = data[scan];
data[scan] = data[scan+1];
data[scan+1]=temp;
}
}
}
}
// ðÅÝÅÅÐòº¯Êý2
public static int[] bubbleSort2(int[] m){

int intLenth = m.length;
/*Ö´ÐÐintLenth´Î*/
for (int i=0;i<intLenth;i++){
/*ÿִÐÐÒ»´Î£¬½«×îСµÄÊýÅÅÔÚºóÃæ*/
for (int j=0; j<intLenth-i-1;j++)
{
int a = m[j];
int b = m[j + 1];
if (a < b)
{
m[j] = b;
m[j + 1] = a;
}
}
}
return m;
}

public static void main(String []args){

// ðÅÝÅÅÐò1
Comparable []c={4,9,23,1,45,27,5,2};
bubbleSort1(c);
for(int i=0;i<c.length;i++)
System.out.println("ðÅÝÅÅÐò1£º"+c[i]);

System.out.println("*******************");

// ðÅÝÅÅÐò2
int []b = {4,9,23,1,45,27,5,2};
int []e = bubbleSort2(b);
for(int j=0;j<e.length;j++)
System.out.println("ðÅÝÅÅÐò2£º"+e[j]);
}


Ïà¹ØÎĵµ£º

Ϸ˵java web¿ª·¢ÖеÄlistenerºÍfilter

ÎÄÕÂת×Ô£ºhttp://javastudy.blog.51cto.com/183528/78723
jsp¿ª·¢ÖеĠ¼àÌýÆ÷ºÍ¹ýÂËÆ÷£¬ÕâÁ½¸ö¶«Î÷Ҫ˵ÆðÀ´£¬ºÜ´ó£¬ºÜ·±¡£½ñÌìÎÒÏëÓÃÒ»¸öÏÖʵµÄÀý×Ó£¬À´ËµÃ÷ÕâÁ½¸ö¶«¶«µÄ×÷Óá£
°¸ÀýÃèÊö
        ¼ÙÉèÄãƽʱÉú»îÔÚ±±¾©£¬ÓÐÌìÄãÈ¥Ò»¸öºÜ±ßÔ¶ºÜƶÇîµÄɽ´åÌåÑéÉú»î£¬µ½ÁËÄǸ ......

JAVAÖÐÓÃÓÚ´¦Àí×Ö·û´®µÄ¡°ÈýÐֵܡ±

JAVAÖÐÓÃÓÚ´¦Àí×Ö·û´®µÄ“ÈýÐֵܔ
JAVAÖÐÓÃÓÚ´¦Àí×Ö·û´®³£ÓõÄÓÐÈý¸öÀࣺjava.lang.String¡¢java.lang.StringBuffer¡¢java.lang.StringBuilder£¬ÕâÈýÕߵĹ²Í¬Ö®´¦¶¼ÊÇfinalÀ࣬²»ÔÊÐí±»¼Ì³Ð£¬ÕâÖ÷ÒªÊÇ´ÓÐÔÄܺͰ²È«ÐÔÉÏ¿¼Âǵģ¬ÒòΪÕ⼸¸öÀ඼ÊǾ­³£±»Ê¹ÓÃ×ŵģ¬ÇÒ¿¼Âǵ½·ÀÖ¹ÆäÖеIJÎÊý±»ÐÞ¸ÄÓ°Ïìµ½ÆäËüµÄÓ¦Óᣠ......

Javaͬ²½»úÖÆ£ºsychronized¶Ô´úÂëÓ°Ïì

ת £ºhttp://kuru.javaeye.com/blog/288467
Java¶Ô¶àÏ̵߳ÄÖ§³ÖÓëͬ²½»úÖÆÉîÊÜ´ó¼ÒµÄϲ°®£¬Ëƺõ¿´ÆðÀ´Ê¹ÓÃÁËsynchronized¹Ø¼ü×־ͿÉÒÔÇáËɵؽâ¾ö¶àÏ̹߳²ÏíÊý¾Ýͬ²½ÎÊÌâ¡£µ½µ×ÈçºÎ£¿¨D¨D»¹µÃ¶Ôsynchronized¹Ø¼ü×ÖµÄ×÷ÓýøÐÐÉîÈëÁ˽â²Å¿É¶¨ÂÛ¡£ ×ܵÄ˵À´£¬synchronized¹Ø¼ü×Ö¿ÉÒÔ×÷Ϊº¯ÊýµÄÐÞÊηû£¬Ò²¿É×÷Ϊº¯ÊýÄÚµÄÓï¾ä£¬Ò ......

javaÕýÔò±í´ïʽÖеÄÊýÁ¿´Ê

    javaÖеÄÕýÔòλÓÚjava.util.regex°üÖУ¬Õâ¸ö°üÖÐÖ»ÓÐÒ»¸öMatchResult½Ó¿ÚºÍMatcher¡¢PatternÁ½¸öÀà¡£
   ÕýÔòÖеÄÊýÁ¿´ÊÓÐGreedy (Ì°À·)¡¢Reluctant(ÀÁ¶è)ºÍPossessive(Ç¿Õ¼)ÈýÖÖ
  
 Greedy ÊýÁ¿´Ê
X?
X£¬Ò»´Î»òÒ»´ÎҲûÓÐ
X*
X£¬Áã´Î»ò¶à´Î
X+
X£¬Ò»´Î»ò¶à´Î
X{n ......

ËĸöÓꦵÄJava±àÂëÏ°¹ß

³ÌÐòÖеıàÂë·ç¸ñÈÃÎÒÃǵıà³Ì¹¤×÷±äµÃÇáËÉ£¬ÌرðÊdzÌÐòά»¤Ô±£¬ËûÃÇÒª¾­³£ÔĶÁÆäËûÈ˱àдµÄ³ÌÐò±àÂ룬ÕâÒ»µãÓÈÆäÍ»³ö¡£±àÂë¹æ·¶´Ó¸ù±¾ÉϽâ¾öÁ˳ÌÐòά»¤Ô±µÄÄÑÌ⣻¹æ·¶µÄ±àÂëÔĶÁºÍÀí½âÆðÀ´¸üÈÝÒ×£¬Ò²¿ÉÒÔ¿ìËٵIJ»·ÑÁ¦ÆøµÄ½è¼ø±ðÈ˵ıàÂë¡£¶Ô½«À´Î¬»¤Äã±àÂëµÄÈËÀ´Ëµ£¬ÄãµÄ±àÂëÔ½ÓÅ»¯£¬ËûÃǾÍԽϲ»¶ÄãµÄ±àÂ룬Àí½âÆðÀ´Ò²¾ÍÔ½ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ