javaʵÏÖðÅÝÅÅÐòËã·¨
package ch01;
public class BubbleSort
{
public static void main(String[] args){
int[] values ={
3,1,6,2,9,0,7,4,5
};
sort(values);
for(int i=0; i < values.length; ++i){
System.out.println("Index: " + i + "Value: " + values[i]);
}
}
public static void sort(int[] values){
int temp;
for(int i=0 ; i < values.length ; ++i){
for(int j=0; j <values.length - i - 1; ++j){
if(values[j] > values[j + 1]){
temp = values[j];
values[j] = values[j + 1];
values[j + 1] = temp;
&n
Ïà¹ØÎĵµ£º
1.FileÀàΪ¹ÜÀíÎļþºÍĿ¼ÌṩÁË·½·¨£¬Æä¶ÔÏó±íʾһ¸öÎļþ»òÕßĿ¼¡£ËüÌṩÁËÈô¸É·½·¨¶ÔÎļþ»òÎļþ¼Ð½øÐвÙ×÷¡£ÆäÖеÄlist()·½·¨ºÍlistFiles()·½·¨¿ÉÒÔÆðµ½¶¨Î»Ìض¨ÎļþµÄ×÷Óá£
2.ObjectÀ࣬ÊÇËùÓÐJavaÀàµÄ׿ÏÈ£¬ÈôÒ»¸öÀàÉùÃ÷ʱûÓаüº¬extends¹Ø¼ü×Ö£¬ÔòÆäÖ±½Ó¼Ì³ÐÓÚObjetcÀà¡£ÆäÖÐÓÐÐí¶àÖØÒª·½·¨£º
equals(),notify(), ......
¼¯ºÏCollection½Ó¿Ú
--Collection ÊÇÈκζÔÏó×é£¬ÔªËØ¸÷×Ô¶ÀÁ¢£¬Í¨³£ÓµÓÐÏàͬµÄÌ×ÓùæÔò¡£Set ListÓÉËüÅÉÉú¡£
»ù±¾²Ù×÷ Ôö¼ÓÔªËØadd(Object obj); addAll(Collection c);
ɾ³ýÔªËØ remove(Object obj); removeAll(Collection c);
Çó½»¼¯ retainAll(Collection c);
ɾ³ýÔªËØ remove(Object obj); removeAll(Collectio ......
Ò».°¢ÀïÑз¢Ôº-º¼ÖÝ-Java¸ß¼¶³ÌÐòÔ±
ÈËÊý£º1ÈË
ѧÀú£º±¾¿Æ¼°ÒÔÉÏ
¹¤×÷µØµã£ºº¼ÖÝ
ְλÃèÊö:
1¡¢ Éè¼Æ¡¢¿ª·¢¡¢¸Ä½ø»ùÓÚJavaµÄ¹¤¾ßºÍ¿ò¼Ü£»
2¡¢ Ö¸µ¼¿ª·¢ÍŶÓʹÓù¤¾ßºÍ¿ò¼Ü£¬½â¾öÒÉÄÑÎÊÌâ¡£
ְλҪÇó£º
1¡¢ ÊìϤ²¢×ÔÈçÔËÓÃJavaÓïÑÔ¼°JDKÀà¿â£¬¾ß±¸Á¼ºÃµÄ±à³Ìϰ¹ß£»
2¡¢ ÊìϤ¶àÖÖJava¿ªÔ´ÏîÄ¿£¬¾«Í¨Ä¿Ç°Ö÷Á ......