java¶ÔÎļþµÄ²Ù×÷
1Áгö´ÅÅÌ/Îļþ¼ÐÄÚµÄÎļþ
import java.io.File;
import java.io.IOException;
public class Test {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
File f = new File("D:");//´ÅÅÌ
//File f = new File("D:\\µçÓ°");//Îļþ¼Ð
File lf[] = f.listFiles();
for(int i = 0;i<lf.length;i++){
System.out.println(lf[i]);
}
}
}
2¶ÔÎļþµÄ²Ù×÷
import java.io.File;
import java.io.IOException;
public class Test {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
File f = new File("D:\\java.doc");
if(!f.exists()){ //ÅжÏÊÇ·ñ¸ÃÎļþ´æÔÚ
f.createNewFile();//Èç¹û²»´æÔھʹ´½¨
}
System.out.println("ÎļþµÄ·¾¶ÊÇ£º "+f.getAbsolutePath());
System.out.println("ÎļþÊÇ·ñ¿Éд£º "+f.canWrite());
System.out.println("ÎļþÊÇÒÑɾ³ý£º "+f.delete());
}
}
3¶ÔĿ¼µÄ²Ù×÷
import java.io.File;
import java.io.IOException;
public class Test {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
File dir= new File("D:\\java");
if(!dir.exists()){ //ÅжÏĿ¼ÊÇ·ñ´æÔÚ
dir.mkdir();//Èç¹û²»´æÔھʹ´½¨
}
&
Ïà¹ØÎĵµ£º
Apache Byte Code Engineering Library (BCEL)¿ÉÒÔÉîÈë Java
ÀàµÄ×Ö½ÚÂë¡£¿ÉÒÔÓÃËüת»»ÏÖÓеÄÀà±íʾ»òÕß¹¹½¨ÐµÄÀ࣬ÒòΪ BCEL ÔÚµ¥¶ÀµÄ JVM
Ö¸Á±ðÉϽøÐвÙ×÷£¬ËùÒÔ¿ÉÒÔÈÃÄú¶Ô´úÂëÓÐ×îÇ¿´óµÄ¿ØÖÆ¡£²»¹ý£¬ÕâÖÖÄÜÁ¦µÄ´ú¼ÛÊǸ´ÔÓÐÔ¡£ÔÚ±¾ÎÄÖУ¬Java ¹ËÎÊ Dennis Sosnoski
½éÉÜÁË BCEL µÄ»ù±¾ÄÚÈÝ£¬²¢Òýµ¼¶ÁÕßÍê³ÉÒ»¸öʾÀ ......
ÃüÁîÐвÎÊý´¦ÀíÊÇÒ»ÏîÁîÈËÑá·³µÄÁãË鹤×÷£¬²»¹ÜÄú¹ýÈ¥ÒѾ´¦Àí¹ý¶àÉÙ´ÎÁË£¬ËüºÃÏñ×ÜÄÜÖØаÚÔÚÄúµÄÃæÇ°¡£ÓëÆäÒ»±éÓÖÒ»±éµØ±àдͬ
Ò»¿é´úÂëµÄ²»Í¬±äÖÖ£¬ÎªÊ²Ã´²»ÀûÓ÷´ÉäÀ´¼ò»¯²ÎÊý´¦ÀíµÄ¹¤×÷ÄØ£¿Java ¹ËÎÊ Dennis Sosnoski
ÏòÄúչʾÁËÈçºÎ×öµ½ÕâÒ»µã¡£ÔÚ±¾ÎÄÖУ¬Dennis ¼òÃ÷¶óÒªµØ½éÉÜÁËÒ»¸ö¿ªÔ´¿â£¬Õâ¸ö¿â¿ÉÒÔʹµÃÃüÁîÐÐ ......
ÔÚJDK1.5֮ǰ£¬¶Ô¸ßÖÊÁ¿Java¶àÏ̲߳¢·¢³ÌÐòÉè¼Æʱ£¬Îª·ÀÖ¹³ÌÐò±ÀµôµÈÏÖÏóµÄ³öÏÖ£¬±ÈÈçʹÓÃwait()¡¢notify()ºÍsynchronizedµÈ£¬ÐèÒª¿¼ÂÇÐÔÄÜ¡¢ËÀËø¡¢¹«Æ½ÐÔ¡¢×ÊÔ´¹ÜÀíÒÔ¼°ÈçºÎ±ÜÃâḬ̈߳²È«ÐÔ·½Ãæ´øÀ´µÄΣº¦µÈÖî¶àÒòËØ£¬Í¨³£»á²ÉÓÃһЩ½ÏΪ¸´Ôӵݲȫ²ßÂÔ£¬¼ÓÖØÁ˳ÌÐòÔ±µÄ¿ª·¢¸ºµ£¡£ÔÚJ ......
/**
* ½»»»ÅÅÐò-ðÅÝÅÅÐò£¬ºËÐÄ˼Ïë ÒÔ´óСΪÒÀ¾Ý½»»»
*
* */
public void bubbleSort(double[] a){
//½«Òª½øÐбȽϵÄÊý´óµÄ¾¡Á¿ÍùºóÅÅ£¬Ã¿´ÎÑ»·°Ñ×î´óµÄÅÅÔÚÒªÅÅÐòÊý×éµÄĩλ¡£
boolean hasSwap = true;
for(int i = 1; i < a.length&& hasSwap; i ++){//Ñ»·µÄ´ÎÊý
hasSwap = ......