java³£ÓÃÎļþ²Ù×÷¼¯ºÏÀà
package com.shxy.code;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.zip.Adler32;
import java.util.zip.CheckedOutputStream;
import org.apache.tools.zip.ZipEntry;
import org.apache.tools.zip.ZipOutputStream;
/**
* ÎļþÏà¹Ø²Ù×÷£¨£©
* @author gaoyusi
*
*/
public class FileHelper {
/**
* ½«ÎļþÓÉÖ¸¶¨Â·¾¶¿½±´µ½Ö¸¶¨Â·¾¶
* Èç¹ûÖ¸¶¨Â·¾¶Îļþ²»´æÔÚ£¬Ôò×Ô¶¯´´½¨¸ÃÎļþ
* @param src ÎļþµÄԴ·¾¶
* @param dis Îļþ¸´ÖƵÄÄ¿µÄ·¾¶
*/
public void copyFile(String src, String dis) throws IOException{
File srcFile=new File(src);
File disFile=new File(dis);
//ÕÒ²»µ½Ô´Îļþ
if(!srcFile.exists()){
throw new IOException("ÕÒ²»µ½Ô´Îļþ£¡");
}
try{
//create distinct file
createNewFile(disFile);
Ïà¹ØÎĵµ£º
Java ÖÐÄÚ²¿¶¯Ì¬Àà(ûÓÐstatic)¹Ø¼ü×ÖºÍÄÚ²¿¾²Ì¬ÀàµÄ¾ÍÔÚÓÚÄÚ²¿¶¯Ì¬À಻Äܶ¨Ò徲̬±äÁ¿»òÊǾ²Ì¬·½·¨,Èç¹ûÒªÔÚÄÚ²¿ÀàÖÐʹÓþ²Ì¬³ÉÔ±,±ØÐ뽫ÀàÉùÃ÷Ϊ¾²Ì¬Àà.
ÄÚ²¿ÀàÖеľ²Ì¬·½·¨¿ÉÒÔ·ÃÎÊÍⲿÀàµÄ¾²Ì¬·½·¨ºÍ±¾ÀàÖеľ²Ì¬·½·¨»ò³ÉÔ±, ·Ç¾²Ì¬·½·¨¿ÉÒÔ·ÃÎÊÆäËûËùÓеķ½·¨»ò³ÉÔ± ......
¼°Ê±Ïû³ý²»Ê¹ÓõĶÔÏóµÄÒýÓÃ, ÀíÂÛÉÏ, ´øÓÐÄÚ´æ¹ÜÀíµÄÓïÑÔÊDz»´æÔÚÄÚ´æй©µÄ, µ«ÊÇÈç¹û¶Ô¶ÔÏóµÄ²Ù×÷²»µ±,Ò²ÊÇ¿ÉÄÜ»áÔì³ÉÄÚ´æй©.
ÈçÓÐÒ»¸östack, Æäpopº¯ÊýÈçÏÂ.
public Object pop()
{
if( Element.length() == 0) return nu ......
package PairTestMyCode.copy;
import java.util.*;
public class PairTest2
{
public static void main(String[] args)
{
GregorianCalendar[] birthdays =
{
new GregorianCalendar(1906, Calendar.DECEMBER, 9), // G. Hopper
new GregorianCalendar(1815, Cal ......
µ±ÖØÔØequals·½·¨Ê±,×ñѹßÀý.
equals²»ÊÇÿ¸öÀ඼±ØÐëÖØÔØ,µ±ÒÔϼ¸¸öÌõ¼þÂú×ã,¿ÉÒÔ²»ÖØÔØequals.
1. ÀàµÄʵÀýÖ»ÓÐͬһ¸ö²Å±»ÅÐΪÏàµÈ. ÈçThreadÀà.
2. ²»ÓùØÐÄÁ½¸ö¶ÔÏóÊÇ·ñÂß¼ÏàµÈµÄʱºò,»òÊÇ˵±È½Ï¶ÔÏóûÓÐÒâÒå.
3.¸¸ÀàÒѾÖØÔØÁËequals,¶øÇÒ¸¸ÀàµÄequalsÒ²ÊÊÓÃÓÚ×ÓÀà,×ÓÀà¾Í²»ÓÃÖØÔØequals.
4.ÕâÊÇÒ»¸ö˽ÓÐÀà»òÊ ......
ÔÚjavaÏîÄ¿Öе¼Èëweka.jarµÄ°ü,È»ºó°ÑÏÂÃæ´úÂëcopyµ½mainÀïÃæ,
ÓÃeclipseµÄ»°×Ô¶¯import°É.
×¢ÒâÒ»ÏÂÄǸöÎļþµÄ·¾¶ÊÇ·ñÕýÈ·.
import
java.io.File;
import
weka.classifiers.Classifier;
import
weka.classifiers.trees.J48;
import
weka.core.Instances;
import
weka.core.converters.ArffLoader;
½ ......