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

java»ù´¡ÈëÃÅѧϰ±Ê¼Ç(Ò»):bubblesortËã·¨¸öÈËѧϰ


public class bubblesort {
 public static void main(String[] args) {
 
   int array[]=new int[]{1,5,9,4,6,2};   
   
   int m;
  
   for(int i=0;i<array.length;i++){
    System.out.print(array[i]+" ");
    }
   System.out.println();
 
  
   for(int k=0;k<array.length;k++)
   {
    for(int j=k+1;j<array.length;j++)
    {
      if(array[k]<array[j])
        {
      
              continue;
        }
              else{
               m=array[k];
               array[k]=array[j];
               array[j]=m;
              
               }
     
          }
    System.out.print(array[k]+" ");
   }
 }
}
¿ªÊ¼Ö®Ç°ÓÃ2¸öÊý×飻һ¸öÊý×é´æ·ÅÔ­Êý¾Ý£¡ÁíÒ»¸öÊý×éÓÃÀ´´æ·Å½á¹û£¡
ʵÏÖÆðÀ´×ÜÊǵ¯³öjava.lang.ArrayIndexOutOfBoundsException Êý×鳬³ö±ß½çʲôµÄÒì³££¡
Ò»À´»ù´¡ÊµÔÚ±¡Èõ£¡ ¶þÀ´Õ¼Óÿռä´ó£¡
ÔÚǶÌ×forÑ­»·Ï¶Ôj£»kµÄÔ¼ÊøÌõ¼þÐèҪעÒ⣻
֮ǰ¿´¹ýһЩ½Ì³Ì¶ÔÓÚ¶¨Òå±äÁ¿µÄλÖÃÓÐÒ»µãdzÏÔµÄÈÏʶ£»ÔÚforÑ­»·ÀïÃ涨Òå±äÁ¿ µ±forÑ­»·½áÊøºó±ã¿ÉÒÔ±»»ØÊÕ£¡ÓÐÀûÓÚ¿Õ¼äµÄ½ÚÊ¡£»


Ïà¹ØÎĵµ£º

javaʵÏÖ×ÊÔ´ÏÂÔØ

/Download   by   HTTP  
//For   other   protocol,   do   it   yourself  
import   java.net.*;  
import   java.io.*;  
public   class   DonwLoa ......

Eclipse Java×¢ÊÍÄ£°åÉèÖÃÏê½â


ÉèÖÃ×¢ÊÍÄ£°åµÄÈë¿Ú£º Window->Preference->Java->Code Style->Code Template È»ºóÕ¹¿ªComments½Úµã¾ÍÊÇËùÓÐÐèÉèÖÃ×¢Ê͵ÄÔªËØÀ²¡£ÏÖ¾Íÿһ¸öÔªËØÖðÒ»½éÉÜ£º
Îļþ(Files)×¢ÊͱêÇ©£º
/**   
* @Title: ${file_name}
* @Package ${package_name}
* @Description: ${todo}(ÓÃÒ»¾ä»°ÃèÊö¸ÃÎļ ......

minaÖ®ÐÔÄÜȱÏݼ°bug,java¸ßÐÔÄÜÓÎÏ··þÎñÆ÷ºÎÔÚ?

Apache MINA (mina-2.0.0-M6Ô´ÂëΪÀý):
    ÎÒÃÇʹÓÃmina nio tcp×î³£ÓõÄÑùÀýÈçÏÂ:
        NioSocketAcceptor acceptor = new NioSocketAcceptor(/*NioProcessorPool's size*/);
        DefaultIoFilterChainBuilder cha ......

javaÖÐÊý×éÓëListÏ໥ת»»µÄ·½·¨

1.Listת»»³ÉΪÊý×é¡££¨ÕâÀïµÄListÊÇʵÌåÊÇArrayList)
¡¡¡¡µ÷ÓÃArrayListµÄtoArray·½·¨¡£
¡¡¡¡toArray
¡¡¡¡public <T> T[] toArray(T[] a)·µ»ØÒ»¸ö°´ÕÕÕýÈ·µÄ˳Ðò°üº¬´ËÁбíÖÐËùÓÐÔªËصÄÊý×飻·µ»ØÊý×éµÄÔËÐÐʱÀàÐ;ÍÊÇÖ¸¶¨Êý×éµÄÔËÐÐʱÀàÐÍ¡£Èç¹ûÁбíÄÜ·ÅÈëÖ¸¶¨µÄÊý×飬Ôò·µ»Ø·ÅÈë´ËÁбíÔªËصÄÊý×é¡£·ñÔò£¬½«¸ù¾ ......

ÔÚjavaÖÐʹÓÃίÍÐʵÏÖmap/filter

ÔÚjavaÖУ¬¼ÙÉèÄãÓÐÒ»¸öuser ¶ÔÏóµÄlist£¬´Ëuser¶ÔÏó·â×°ÁËÓû§µÄid, first name, last name and age. È»ºóÄãÏëµ÷ÓÃÒ»¸öweb service(eg. UserService.deleteUsersByIds(List<Integer> userIds) ȥɾ³ýÊý¾Ý¿âÖÐÖ¸¶¨µÄÕâЩuser¡£  ÌýÆðÀ´Ëƺõ²»Ì«À§ÄÑ£¬²»ÊÇô? ÄãËùÐèÒªÖ»Êǽ« List<User> ת»¯³ÉList&l ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ