JAVAСÀý×Ó½âÎöË㷨ЧÂÊ
½ñÌì±¾À´ÏëÊìϤһÏÂJ2SEµÄÄÚÈÝ£¬²»ÏëÔÚ±àд¹ý³ÌÖÐͻȻ¿¼Âǵ½Ò»¸öÎÊÌ⣬JAVAËã·¨µÄЧÂÊ£¬´ó¼ÒÏÈ¿´ÎÒ×Ô¼ºÐ´µÄÒ»¸öСÀý×Ó£º
public class NumSort {
public static void mian (String args[]) {
int a[] = new int[args.length];
for (int i=0;i<args.length;i++) {
a[i] = Integer.parseInt(args[i]);
}
print(a);
selectionSort(a);
print(a);
}
private static void selectionSort(int a[]) {
for (int i=0;i<=a.length;i++) {
for (int j=i+1;j<a.length;j++) {
if (a[j]<a[i]) {
int temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
}
private static void print(int a[]) {
for (int i=0;i<=a.length;i++) {
System.out.print(a[i] + " ");
}
System.out.println();
}
}
Õâ¸öС³ÌÐòʵÏֵŦÄÜÊÇ´Ó¼üÅÌÊäÈëÒ»´®×Ö·û£¬½«ËûÃÇת»»³ÉintÀàÐ͵ÄÊý£¬²¢ÊµÏÖÑ¡ÔñÅÅÐò£¬½«½á¹ûÊä³ö£¬ÄÇôÎÒÃÇ°´ÉÏÃæµÄËã·¨À´¿´Õâô¸öÐòÁУº1 4 6 7 3 5 2 9 8 ÎÒÃÇ¿´4£¬µ±4Óë3±È½ÏµÄʱºò»áÓÐÒ»´Î½»»»£¬¶øµ±3Óë2ÔٱȽϵÄʱºò»¹ÓÐÒ»´Î½»»»£¬ÎÒÃÇ˵Õâ´Î½»»»ÊÇûÓбØÒªµÄ£¬ÎÒÃÇÀíÏëµÄ×ö·¨ÊÇÿһ´Î±éÀú¶¼ÄÜÖ»½»»»Ò»´Î¶øÕÒ³ö´Ë´Î±éÀúÀï×îСµÄÊý£¬ÎÒÃǵķ½·¨ÊÇÔÙÉèÖÃÒ»¸ö¼ÆÊýj£¬ÈÃj¼ÇסÎÒÃÇÒª½»»»µÄλÖ㬠¼´ÎÒÃÇÕÒµ½3Ö®ºó£¬ÄÃ3ºÍºóÃæµÄÊýÔÙ½øÐбȽϣ¬Èç¹ûûÓбÈ3СµÄ¾Í½»»»£¬Èç¹û·¢ÏÖ±È3СµÄ£¬Èç´Ë´¦µÄ2£¬ÔòjÒƶ¯µ½2µÄλÖã¬×îºóÔÙ½»»»£¬ÈÃÎÒÃÇ¿´ÏÂÃæµÄС³ÌÐò£º
public class GoodNumSort {
public static void mian (String args[]) {
int a[] = new int[args.length];
for (int i=0;i<args.length;i++) {
a[i] = Integer.parseInt(args[i]);
}
print(a);
selectionSort(a);
print(a);
}
private static void selectionSort(int a[]) {
int k,temp;
Ïà¹ØÎĵµ£º
Java2ºËÐļ¼ÊõµÚÆß°æÖÐÎÄ°æµÚ¶þ¾í
µÚ600Ò³£¬¾¯¸æ´¦ÕâÑù˵£º
Èç¹û½«jar·ÅÈëjre/lib/extĿ¼ÖУ¬²¢ÇÒÔÚËüµÄÀàÖÐÓÐÒ»¸öÀàÐèÒªµ÷ÓÃϵͳÀà»òÕßÀ©Õ¹À࣬ÄÇô¾Í»áÓöµ½Âé·³¡£À©Õ¹Àà¼ÓÔØÆ÷²¢²»Ê¹ÓÃÀà·¾¶¡£
¸Õ¶Áµ½ÕâÀïÊ®·Ö²»½â£¬ÎªÊ²Ã´Óõ½ÏµÍ³Àà»òÀ©Õ¹Àà»á·¢Éú´íÎ󣿲¢ÇÒÒ»¸öÀàÔõô¿ÉÄܲ»»áÓõ½ÏµÍ³ÀࣿÓÚÊÇ£¬ÕÒµ½Ó¢ÎÄ°æÔÎÄÈ ......
package com.tiantian;
import java.util.*;
public class JAVAContainer {
public static void main(String[] args) throws Exception {
// ArrayList
{
&nb ......
1, ±£Ö¤Ḭ̈߳²È«µÄÈýÖÖ·½·¨:
a, ²»Òª¿çÏ̷߳ÃÎʹ²Ïí±äÁ¿
b, ʹ¹²Ïí±äÁ¿ÊÇfinalÀàÐ͵Ä
c, ½«¹²Ïí±äÁ¿µÄ²Ù×÷¼ÓÉÏͬ²½
2, Ò»¿ªÊ¼¾Í½«ÀàÉè¼Æ³ÉḬ̈߳²È«µÄ, ±ÈÔÚºóÆÚÖØÐÂÐÞ¸´Ëü,¸üÈÝÒ×.
3, ±àд¶àÏ̳߳ÌÐò, Ê×Ïȱ£Ö¤Ë ......
ÄÚ´æÒç³öÓëÊý¾Ý¿âËø±íµÄÎÊÌ⣬¿ÉÒÔ˵ÊÇ¿ª·¢ÈËÔ±µÄجÃΣ¬Ò»°ãµÄ³ÌÐòÒì³££¬×ÜÊÇ¿ÉÒÔÖªµÀÔÚʲôʱºò»òÊÇÔÚʲô²Ù×÷²½ÖèÉϳöÏÖÁËÒì³££¬¶øÇÒ¸ù¾Ý¶ÑÕ»ÐÅÏ¢Ò²ºÜÈÝÒ׶¨Î»µ½³ÌÐòÖÐÊÇij´¦³öÏÖÁËÎÊÌâ¡£ÄÚ´æÒç³öÓëËø±íÔò²»È»£¬Ò»°ãÏÖÏóÊDzÙ×÷Ò»°ãʱ¼äºóϵͳԽÀ´Ô½Âý£¬Ö±µ½ËÀ»ú£¬µ«²¢²»ÄÜÃ÷È·ÊÇÔÚʲô²Ù×÷ÉϳöÏֵģ¬·¢ÉúµÄʱ¼äµãҲûÓÐ ......
Java.lang.Thread
Ïß³Ì---³ÌÐòµÄ²»Í¬Ö´Ðз¾¶
Ö÷Ïß³Ìmain·½·¨ ·ÖÖ§Ïß³Ì
Ï̵߳ÄÆô¶¯·¢·¨£º
Á½¸ö
1.
ʵÏÖRunnalble½Ó¿ÚʵÏÖRUN
New Thread(new Runnable).start
2.¼Ì³ÐThreadʵÏÖRUN
New Thread().start
ÔÀí£º
½¨ÒéʹÓõÚÒ»ÖÖ·½·¨
×¢ÒâÇø·Ö·½·¨µ÷ÓÃrunÓëÏß³ÌÆô¶¯µÄ²»Í¬start
  ......