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

javaʵÏÖµÄÑ¡ÔñÅÅÐò

ÏÂÃæÊÇÓÃjavaʵÏÖµÄÑ¡ÔñÅÅÐò£¬Ã¿´Î´ÓÊý×éÖÐÑ¡È¡×îСµÄÖµ£º
import java.util.Date;
import java.util.Random;
/*
* Ñ¡ÔñÅÅÐò
*/
public class SelectSort {
public static void main(String args[])
{
int len = 40;
Date date = new Date();
Random random = new Random(date.getSeconds());
int data[]=new int[len];
for(int i = 0; i < len; i++)
{
data[i]=(int)(random.nextFloat()*100+1);
}
System.out.println("Select sort:");
show(data);
selectSort(data);
show(data);
}

private static void selectSort(int[] data)
{
int length = data.length;
for(int i=0; i<length-1; i++)
{
int temp = data[i];
for(int j=i+1; j<length; j++)
{
if(data[j] < temp )
{
data[i] = data[j];
data[j] = temp;
temp = data[i];
}
}
data[i]=temp;

}
}

private static void show(int[] data)
{
System.out.println("========================");
for(int i = 0; i < data.length; i++)
{
System.out.print(data[i] + " ");
}
System.out.println();
System.out.println("========================");
}
}


Ïà¹ØÎĵµ£º

Java´«ÖµºÍ´«ÒýÓ㺠ÕÅÈýºÍÀîËĵĹÊÊÂ


ÏÂÃ濪½²¹ÊÊ£º 
´ÓÇ°Óиö·¿¼ä£¬·¿¼äÀïÓзÝÎĵµ£¬·¿¼ä»¹ÓÐÒ»°ÑÔ¿³×¡£ Õâ°ÑÔ¿³×ÔÚÕÅÈýÊÖÀï¡£ 
ÕâʱÀîËÄÀ´ÏòÕÅÈýÒªÄÇ·ÝÎĵµ¡£ ÕÅÈý²»Ì«Ï²»¶ÀîËÄ£¬µ«ÓÖŵ¢ÎóÁË
¹¤×÷²»ºÃ½»´ú¡£ÓÚÊÇÕÅÈý¾Í°Ñ·¿¼äÀïÎĵµµÄÎĵµ¸´Ó¡ÁËÒ»·Ý£¬È»ºó°ÑÄǸö¸´Ó¡¼þ½»¸øÁËÀîËÄ£¨Õâ½Ð´«Öµ£©¡£ 
ÀîËÄÄõ½Îĵµºó£¨¸´Ó¡¼þ£©£¬ºúÂÒÐÞ¸ÄÒ» ......

Java SE ¶àÏß³Ì

package thread;
class TestThread extends Thread {
 public void run(){
  while(true){
   System.out.println(Thread.currentThread().getName());
  }
 }
}
public class ThreadDemo {
 /**
  * @param args
  */
 public static void ......

Java¶¨Ê±Æ÷

ÔÚÓ¦Óÿª·¢ÖУ¬¾­³£ÐèҪһЩÖÜÆÚÐԵIJÙ×÷£¬±ÈÈçÿ5·ÖÖÓÖ´ÐÐijһ²Ù×÷µÈ¡£ÔÚWEBÏîÄ¿ÖпÉÄÜÐèҪÿ¸ôÒ»¶Îʱ¼ä×Ô¶¯Éú³É¾²Ì¬Ò³£¬×Ô¶¯¼ì²âÊÇ·ñÓÐÐÂÓʼþ£¬¶¨Ê±×Ô¶¯±¸·ÝÎļþµÈ²Ù×÷¡£ÕâЩ¶¼¿ÉÒÔͨ¹ý¶¨Ê±Æ÷TimerÀ´½â¾ö¡£
ÕâÀï½öÌṩ¶¨Ê±Æ÷µÄ²¿·Ö·½·¨ºÍ˵Ã÷£¬¾²Ì¬Ò³Éú³ÉµÈ²Ù×÷¶ÁÕß¿ÉÒÔͨ¹ýÏà¹Ø·½·¨×ÔÐнâ¾ö¡£
¡£¡£¡£°Ù¶È¿Õ¼äÌù´úÂë×ÜÊ ......

Java SE ¶àÏß³Ì Ïß³ÌͨÐÅ

package thread;
class QQ{
 private String name;
 private String sex;
 boolean flag=false;
 public synchronized void put(String name,String sex){
  if(flag)
   try {
    wait();
   } catch (InterruptedException e ......

Java·ºÐ;Žë

1¡¢²»¿ÉÒÔÓÃÒ»¸ö±¾µØÀàÐÍ£¨Èçint   float£©À´Ìæ»»·ºÐÍ
2¡¢ÔËÐÐʱÀàÐͼì²é£¬²»Í¬ÀàÐ͵ķºÐÍÀàÊǵȼ۵ģ¨Pair<String>ÓëPair<Employee>ÊÇÊôÓÚͬһ¸öÀàÐÍPair£©£¬
     ÕâÒ»µãÒªÌرð×¢Ò⣬¼´Èç¹ûa instanceof Pair<String>==trueµÄ»°£¬²¢²»´ú±ía.getFirst()µÄ·µ»ØÖµÊÇÒ»¸öS ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ