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

javaÎļþºÍÎļþ¼ÐµÄ²Ù×÷

import java.io.BufferedReader;  
import java.io.File;  
import java.io.FileInputStream;  
import java.io.FileOutputStream;  
import java.io.FileWriter;  
import java.io.IOException;  
import java.io.InputStream;  
import java.io.InputStreamReader;  
import java.io.PrintWriter;  
import java.util.StringTokenizer;  
public class FileOperate {  
    private String message;  
    public FileOperate() {  
    }  
    /** 
     * ¶ÁÈ¡Îı¾ÎļþÄÚÈÝ 
     * @param filePathAndName ´øÓÐÍêÕû¾ø¶Ô·¾¶µÄÎļþÃû 
     * @param encoding Îı¾Îļþ´ò¿ªµÄ±àÂ뷽ʽ 
     * @return ·µ»ØÎı¾ÎļþµÄÄÚÈÝ 
     */  
    public String readTxt(String filePathAndName,String encoding) throws IOException{  
     encoding = encoding.trim();  
     StringBuffer str = new StringBuffer("");  
     String st = "";  
     try{  
      FileInputStream fs = new FileInputStream(filePathAndName);  
      InputStreamReader isr;  
      if(encoding.equals("")){  
       isr = new InputStreamReader(fs);  
      }else{  
       isr = new InputStreamReader(fs,encoding);  
      }  
      BufferedReader br = new BufferedReader(isr);  
      try{  
  


Ïà¹ØÎĵµ£º

Java»ñȡϵͳӲÅ̺ÍÄÚ´æÊ¹ÓÃÇé¿ö£»

ʹÓÃÀàjava.io.File
1.»ñȡϵͳӲÅÌÐÅÏ¢£º
public static String getDiskInfo() {
StringBuffer sb=new StringBuffer();
File[] roots = File.listRoots();// »ñÈ¡´ÅÅÌ·ÖÇøÁбí
for (File file : roots) {
long totalSpace=file.getTotalSpace();
long freeSpace=file.getFreeSpace();
long usa ......

JAVA±íµ¥×Ô¶¨ÒåµÄÉèÏëÓëºÃ´¦

˵µ½OAϵͳ¾Í»áÏëµ½·¢²¼¹«¸æ¡¢ÉóÅúÎļþ¡¢Îļþ¹ÜÀíµÈµÈÕâЩ¹¦ÄÜ£¬£¬µ½ÁË¿ª·¢ÈËÔ±ÊÖÀï¾ÍÊÇ´æ´¢Êý¾Ý¡¢²éѯÊý¾Ý£¬ÍùÍù²»Í£µÄ×öÖØ¸´¹¤×÷£¬ÓÚÊǾÍÓÐÁËOA±íµ¥ÒýÇæµÄÉèÏëºÍ¹¹Ë¼¡£ÓÃjavascript¶¨Òå±íµ¥£¬ÓÃjavaÇý¶¯XML£¬×Ô¶¯´´½¨¡¢ÐÞ¸ÄÊý¾Ý¿â¡£ÊµÏÖ¶Ô±íµ¥µÄͼÐλ¯ÖÆ×÷£¬¼´Ê¹ÊǷǼ¼ÊõÈËÔ±Ò²¿ÉËæÒâÉè¼Æ³ö×Ô¼º¹¹ÏëµÄ±íµ¥¹¦ÄÜ¡£
JAVA³ÌÐ ......

JavaÕýÔò±í´ïʽÏê½â


Èç¹ûÄãÔø¾­ÓùýPerl»òÈÎºÎÆäËûÄÚ½¨ÕýÔò±í´ïʽ֧³ÖµÄÓïÑÔ£¬ÄãÒ»¶¨ÖªµÀÓÃÕýÔò±í´ïʽ´¦ÀíÎı¾ºÍÆ¥ÅäģʽÊǶàô¼òµ¥¡£Èç¹ûÄã²»ÊìϤÕâ¸öÊõÓÄÇô“ÕýÔò±í´ïʽ”£¨Regular Expression£©¾ÍÊÇÒ»¸ö×Ö·û¹¹³ÉµÄ´®£¬Ëü¶¨ÒåÁËÒ»¸öÓÃÀ´ËÑË÷Æ¥Åä×Ö·û´®µÄģʽ¡£
Ðí¶àÓïÑÔ£¬°üÀ¨Perl¡¢PHP¡¢Python¡¢JavaScriptºÍJScript£¬¶¼Ö§ ......

Object Ordering java ÅÅÐò

Object Ordering
A List l may be sorted as follows.
Collections.sort(l);
If the List consists of String elements, it will be sorted into alphabetical order. If it consists of Date elements, it will be sorted into chronological order. How does this happen? String and Date both implement the Compara ......

JavaʵÑéÐĵÃ

µÚ1Õ JavaÓïÑÔ¸ÅÊö
1.1 ֪ʶ¸ÅÀ¨
1.2 ʵÑéÁ·Ï°
1.2.1 Ò»¸ö¼òµ¥µÄÓ¦ÓóÌÐò
classÀï²»ÄÜÔÙÓÐclass£¬ÎÞÂÛÓÐûÓÐpublicÐÞÊΣ¬class¶¼ÊÇÆ½ÐйØÏµ£¬ÔÚbinÎļþ¼ÐÖлá²úÉú¸÷×ÔµÄ×Ö½ÚÂëÎļþ¡£Í¬Ò»¸ö.javaÔ´ÎļþÖÐÖÁ¶àÓÐÒ»¸öpublic class£¬Èç¹û²»ÏëÔÙÒ»¸öÔ´ÎļþÖÐд¶à¸öÀ࣬¾Í¸÷×ÔдԴ³ÌÐò£¬²¢°ÑÀ๫Ó㬼´ÓÃpublicÐÞÊΡ£
1.2.2 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ