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

javaÎļþ²Ù×÷

 1.´´½¨Îļþ¼Ð 
File myFolderPath = new File(%%1); 
try { 
if (!myFolderPath.exists()) { 
     myFolderPath.mkdir(); 


catch (Exception e) { 
System.out.println("н¨Ä¿Â¼²Ù×÷³ö´í"); 
e.printStackTrace(); 
}  
 
2.´´½¨Îļþ 
File myFilePath = new File(%%1); 
try { 
if (!myFilePath.exists()) { 
myFilePath.createNewFile(); 

FileWriter resultFile = new FileWriter(myFilePath); 
PrintWriter myFile = new PrintWriter(resultFile); 
myFile.println(%%2); 
resultFile.close(); 

catch (Exception e) { 
System.out.println("н¨Îļþ²Ù×÷³ö´í"); 
e.printStackTrace(); 
}  
 
3.ɾ³ýÎļþ 
File myDelFile = new File(%%1); 
try { 
myDelFile.delete(); 

catch (Exception e) { 
System.out.println("ɾ³ýÎļþ²Ù×÷³ö´í"); 
e.printStackTrace(); 
}  
 
4.ɾ³ýÎļþ¼Ð 
File delFolderPath = new File(%%1); 
try { 
delFolderPath.delete(); //ɾ³ý¿ÕÎļþ¼Ð 

catch (Exception e) { 
System.out.println("ɾ³ýÎļþ¼Ð²Ù×÷³ö´í"); 
e.printStackTrace(); 
}  
 
5.ɾ³ýÒ»¸öÎļþϼÐËùÓеÄÎļþ¼Ð 
File delfile=new File(%%1); 
File[] files=delfile.listFiles(); 
for(int i=0;i<files.length;i++){ 
if(files[i].isDirectory()){ 
files[i].delete(); 
    } 
}  
 
6.Çå¿ÕÎļþ¼Ð 
File delfilefolder=new File(%%1); 
try { 
if (!delfilefolder.exists()) { 
delfilefolder.delete(); 

delfilefolder.mkdir(); 

catch (Exception e) { 
System.out.println("Çå¿ÕĿ¼²Ù×÷³ö´í"); 
e.printStackTrace(); 
}  
 
7.¶ÁÈ¡Îļþ 
// ÖðÐжÁÈ¡Êý¾Ý 
FileReader fr = new FileReader(%%


Ïà¹ØÎĵµ£º

Java ÊäÈë/Êä³ö

 ÔÚjavaÓïÑÔÖУ¬I/OµÄ·½Ê½ÊÇÁ÷µÄ·½Ê½¡£Á÷£¨stream£©ÕâÊǸöѧϰjavaÊäÈëÊä³öµÄ×î»ù±¾µÄ¸ÅÄî¡£Á÷ÊÇ×Ö½Ú´ÓÔ´µ½Ä¿µÄµÄÓÐÐòÐòÁС£Ò»·½ÃæÊÇ×Ö½Ú£¬Ò»·½ÃæÊÇÓÐÐòµÄ¡£Á÷ÃèÊöµÄÊÇÒ»¸ö¹ý³Ì£¬Ë³ÐòÑϸñ¡£Ò»¸öÐèÒª¼üÅÌÊäÈëµÄ³ÌÐò¿ÉÒÔÓÃÁ÷À´×öµ½ÕâÒ»µã¡£Á½ÖÖ»ù±¾µÄÁ÷ÊÇ£ºÊäÈëÁ÷ºÍÊä³öÁ÷¡£Äã¿ÉÒÔ´ÓÊäÈëÁ÷¶Á£¬µ«Äã²»ÄܶÔËüд¡£Òª´ÓÊäÈëÁ ......

Java ==Óëequals()µÄÇø±ð

 ÎÒÃÇÀ´½éÉÜһϠ£½£½ºÍequals()µÄÇø±ð£¬£½£½ÊÇÏàµÈ£¬equals()Ò²ÊÇÏàµÈ¡£ÕâÁ½¸ö´ÊµÄÇø±ðÊÇʲôÄØ£¿ÕâÊÇÕÒ¹¤×÷ʱºÜ¶àÃæÊÔ¹ÙµÄÎÊÌâ¡£ÎÒÃÇÀ´½â´ðһϡ£Ê×ÏÈÎÒÃÇ¿´Õâô¸öÀý×Ó¡£Êµ¼ù£º
public class TestEquals {
public static void main(String[] args) {
MyDate date1 = new MyDate(14, 3, 1976);
MyDate date2 = ne ......

Java¶ÔÏó´®Ðл¯ÊµÀý

 1.StudentList.java:
/**
 *
 * @author lucifer
 */
package JavaSerializable;
import java.util.*;
import java.io.*;
public class StudentList implements Serializable{
     Vector list = new Vector(6);
     public StudentList(){} ......

treePanel json javaºǫ́

 function createTreeMenu(){//´´½¨Ò»¸öÊ÷µÄÃæ°å
 var treeMenu = new Ext.tree.TreePanel({
  lines : true,
  minSize : 150,
  border : false,
  root : new Ext.tree.AsyncTreeNode({text : 'root'}),
  loader : new Ext.tree.TreeLoader({dataUr ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ