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

JavaµÝ¹é


Java±éÀúÎļþ¼ÐµÄ2ÖÖ·½·¨£º
A.²»Ê¹Óõݹ飺
import java.io.File;
import java.util.LinkedList;
public class FileSystem {
public static void main(String[] args) {
long a = System.currentTimeMillis();
LinkedList list = new LinkedList();
File dir = new File("c:\\java\\");
File file[] = dir.listFiles();
for (int i = 0; i < file.length; i++) {
if (file[i].isDirectory())
list.add(file[i]);
else
System.out.println(file[i].getAbsolutePath());
}
File tmp;
while (!list.isEmpty()) {
tmp = list.removeFirst();
if (tmp.isDirectory()) {
file = tmp.listFiles();
if (file == null)
continue;
for (int i = 0; i < file.length; i++) {
if (file[i].isDirectory())
list.add(file[i]);
else
System.out.println(file[i].getAbsolutePath());
}
} else {
System.out.println(tmp.getAbsolutePath());
}
}
System.out.println(System.currentTimeMillis() - a);
}
}
B.ʹÓõݹ飺
import java.io.File;
import java.util.ArrayList;
public class FileSystem1 {
private static ArrayList filelist = new ArrayList();
public static void main(String[] args) {
long a = System.currentTimeMillis();
refreshFileList("c:\\java");
System.out.println(System.currentTimeMillis() - a);
}
public static void refreshFileList(String strPath) {
File dir = new File(strPath);
File[] files = dir.listFiles();
if (files == null)
return;
for (int i = 0; i < files.length; i++) {
if (files[i].isDirectory()) {
refreshFileList(files[i].getAbsolutePath());
} else {
Strin


Ïà¹ØÎĵµ£º

³ÉΪjava¸ßÊֵİ˴óÌõ¼þ

ÊÀ½çÉϲ¢Ã»ÓгÉΪ¸ßÊֵĽݾ¶£¬µ«Ò»Ð©»ù±¾Ô­ÔòÊÇ¿ÉÒÔ×ñÑ­µÄ¡£ 
1¡¢ÔúʵµÄ»ù´¡ 
Êý¾Ý½á¹¹¡¢ÀëÉ¢Êýѧ¡¢±àÒëÔ­Àí£¬ÕâЩÊÇËùÓмÆËã»ú¿ÆѧµÄ»ù´¡£¬Èç¹û²»ÕÆÎÕËüÃÇ£¬ºÜÄÑд³ö¸ßˮƽµÄ³ÌÐò¡£³ÌÐòÈËÈ˶¼»áд£¬µ«µ±Äã·¢ÏÖдµ½Ò»¶¨³Ì¶ÈºÜÄÑÔÙÌá¸ßµÄʱºò£¬¾ÍÓ¦¸ÃÏëÏëÊDz»ÊÇÒª»Ø¹ýÍ·À´Ñ§Ñ§ÕâЩ×î»ù±¾µÄÀíÂÛ¡£²»ÒªÒ»¿ªÊ¼¾ÍÈ ......

JAVA³£ÓÃÊýѧÀà·½·¨


<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@ËÎÌå" ......

javaͼƬˮӡ

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.font.TextAttribute;
import java.awt.image.BufferedImage;
import java.io.FileOutputStream;
import java.text.AttributedCharacterIterator;
import java.text. ......

javaµÝ¹éʵÏÖººÅµËþ

/*
 * ººÅµËþ£¬´ÓµÚ1¸öÖù×Ó½èÖúµÚ2¸ùÖù×ÓÒƶ¯µ½µÚ3¸ù
 */
public class TowerOfHano {
 
    private int totle;//×ܹ²ÅÌ×ÓÊýÄ¿
    public TowerOfHano(int totle){
       this.totle=totle;
    }
  &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ