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

JAVAÖеÄArray.sort£¨£©·½·¨

»¨Á˵ãʱ¼äÈ¥Ñо¿£¬Ò²ËãСÓÐÊÕ»ñ£º
Arrays.sort()·½·¨ÔÚJDKÀïÓкܶ࣬ÆäÖÐ×ÅÖØ˵ÏÂ
static void
sort(Object[] a)
static
<T> void
sort(T[] a, Comparator<? super T> c)
Ç°Õß²ÎÊýÖеÄÊý×éaÖеÄËùÓÐÔªËرØÐëʵÏÖcomparable½Ó¿Ú£¬¿ÉÒÔÖØÔØcomparableµÄ·½·¨compareTo£¨£©¡£
ºóÕß²ÎÊýÖеÄÊý×éaÖеÄËùÓÐÔªËرØÐëʵÏÖcomparable½Ó¿Ú£»²ÎÊýÖеÄComparatorÒýÓÃc ÊÇ¿ØÖÆÅÅÐò˳ÐòµÄ£¬¿ÉÒÔͨ¹ýʵÏÖComparatorÈ»ºóÖØÔØÆäcompare·½·¨À´¶¨Òå¡£
Èô²»ÖØÔرȽϷ½·¨£¬Ôò½á¹ûΪ×ÔÈ»ÅÅÐò¡£


Ïà¹ØÎĵµ£º

java¿ì »¹ÊÇ c¿ì[c++¿ì],ËÆÊǶø·ÇµÄ̸

    Ê×ÏÈ˵Ã÷Ò»ÏÂÕâ¸ö”¿ì”µÄº¬Òå,ÎÒÏëÒÔÇ°ÄÇЩÌÖÂÛÕâ¸ö»°ÌâµÄÈ˵±È»ÈÏΪÕâ¸ö¿ìÊÇÖ¸³ÌÐòµÄÔËÐÐËÙ¶È,ÖÁÓÚ”Èí¼þ¿ª·¢ËٶȔ¿ÖÅÂÏëҲûÏë,»òÐíÈÏΪÈí¼þ¿ª·¢ËٶȺÍÕâ¸ö»°Ì⳶²»ÉÏÒ»µã¹Øϵ.ÄÇôÕâ¸öÎÊÌâÔÚÍøÉÏËÑËÑ,ËѵÄÒ»´ó¶Ñ,ÄÇЩc/c++ÕóÓªµÄÁÐÁ˺ܶàÀý×ÓÀ´ËµÃ÷c/c++¿ì, javaÕóÓªµÄÒ²ÊÇÈç´ ......

Ò»µÀjavaÌâËù½ÒʾµÄÔ­Àí

¿´µ½Ò»µÀjavaÌ⣬¸Ð¾õºÜ²»´í,ÎÒÔÚÔ­À´µÄ°æ±¾ÉÏÔö¼ÓÁËЩ´úÂ룬һÆðÀ´¿´¿´ÏÂÃæµÄ´úÂ뽫Êä³öʲô
class Father{
int i,j;

Father(){
add(1);
}
void add(int v){
i+=v;
j+=v;
}
void print(){
System.out.println("i:="+i);
System.out.println("j:="+j);
}
}
class C ......

¹ØÓÚJavaÖÐBorderLayout²¼¾ÖµÄÒ»¸ö¾À½áÎÊÌ⣬Çó½Ì

Õâ¸öÎÊÌâÔÚÓÚ  ÔÚFrameÖÐÌí¼Ó×é¼þʱ£¬Ã¿¸ö×é¼þÏÈÉ趨ÁËλÖ㬵«ÊÇÌí¼Óµ½FrameÖкóʼÖÕ»á³öÏÖÎÊÌâ¡£
ÀýÈ磺
class MyGame extends Frame

 
 MyGame()
 {
  Label c[] = new Label[8];
  for(i = 0; i<8; i++)
  {
   c[i] = new Lab ......

java ²Ù×÷×¢²á±í

import java.util.prefs.*;  
public class Registery {  
    String[] keys = {"oa"};  
    String[] values = {"reg"};  
 //°ÑÏàÓ¦µÄÖµ´¢´æµ½±äÁ¿ÖÐÈ¥  
    public void writeValue() {   ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ