Java ʵÏÖÎļþ·Ö¸îºÏ²¢µÄ´úÂë
import java.io.*;
class Fen{
String fileName;
int size;
Fen(String fileName,String size){
this.fileName = fileName;
this.size = Integer.parseInt(size)*1024;
}
public void cut()throws Exception{
int maxx = 0;
File inFile = new File(fileName);
int fileLength = (int)inFile.length(); //È¡µÃÎļþµÄ´óС
int value; //È¡µÃÒª·Ö¸îµÄ¸öÊý
RandomAccessFile inn = new RandomAccessFile(inFile,"r");//´ò¿ªÒª·Ö¸îµÄÎļþ
value = fileLength/size;
int i=0;
int j=0;
//¸ù¾ÝÒª·Ö¸îµÄÊýÄ¿Êä³öÎļþ
for (;j File outFile = new File(inFile.getName()+j+"zzii");
RandomAccessFile outt= new RandomAccessFile(outFile,"rw");
maxx+=size;
for (;i outt.write(inn.read());
}
outt.close();
}
File outFile = new File(inFile.getName()+j+"zzii");
RandomAccessFile outt= new RandomAccessFile(outFile,"rw");
for(;i
outt.write(inn.read());
}
outt.close();
inn.close();
}
}
class He{
String fileName;
String filterName;
He(String fileName,String filterName){
this.fileName = fileName;
this.filterName = filterName;
}
public void unite()throws Exception{
String [] tt;
File inFile = new File("."); //ÔÚµ±Ç°Ä¿Â¼ÏµÄÎļþ
File outFile = new File(fileName); //È¡µÃÊä³öÃû
RandomAccessFile outt= new RandomAccessFile(outFile,"rw");
//È¡µÃ·ûºÏÌõ¼þµÄÎļþÃû
tt = inFile.list(new FilenameFilter(){
public boolean accept(File dir,String name){
String rr = new File(name).toString();
return rr.endsWith(filterName);
}
});
//´òÓ¡³öÈ¡µÃµÄÎļþÃû
for (int i = 0;i System.out.println(tt[i]);
}
//´ò¿ªËùÓеÄÎļþÔÙдÈëµ½Ò»¸öÎļþÀï
for(int i=0;i inFile = new File(tt[i]);
RandomAccessFile inn= new RandomAccessFile(inFile,"r");
int c;
while((c=inn.read())!=-1)
outt.write(c);
}
outt.close();
}
}
public class test{
public static void main(final String [] args)throws Exception{
if(args.length==0){
print();
return;
}
if(args[0].equals("-c")){
Fen cutt = new Fen(args[1],args[2]);
cutt.cut();
}
else if (args[0].equals("-r")){
He hee = new He(args[1],args[2]);
hee.unite();
}
else
Ïà¹ØÎĵµ£º
µ±Ò»¸ö¸´ÔӵĶÔÏó±»¹¹Ôìʱ,ËüµÄ¹¹Ô캯Êý°´ÏÂÃæµÄ˳Ðò±»µ÷ÓÃ(that the order of constructor calls for a complex object is as follows)
1.Æä»ùÀà(base-class)µÄ¹¹Ô캯Êý±»µ÷ÓÃ,Õâ¸ö²½ÖèÒԵݹéµÄ·½Ê½Öظ´,ËùÒÔ×îµ×²ã(the root of hierarchy)µÄ¹¹Ô캯ÊýÊ×Ïȱ»Ö´ÐÐ,È»ºóÊÇËüÉÏÒ»²ãÅÉÉúÀà(the next-deriv ......
ÕâÀïÖ»ÄÜ´ÓÏÔʾÊý¾ÝµÄjspÒ³ÃæÉϵ¼³öµ±Ç°Ò³ÃæµÄÊý¾Ý£¬ÕâЩÊý¾Ý¿ÉÒÔ´ÓÊý¾Ý¿â¶Á³ö£¬ÏÔʾµ½jspÒ³Ãæ£¬È»ºó¼ÓÒ»¶Î»°¾Í¿É°Ñµ±Ç°Ò³ÃæÊý¾Ý±£´æµ½excelÀïÃæ!
Èç´Óºǫ́¹ýÀ´Êý¾ÝÏÔʾµ½ showUser.jsp
È»ºó¼ÓÁ´½Óµ½ showExcel.jsp¾Í¿ÉÒÔÁË£¬ÔÚÕâ¸öÒ³ÃæÖ»¶àÁ˼¸ÐÐ×Ö£¬ÆäËûµÄ¶¼²»»áÏÔʾ°üÀ¨Ò³Ã棡µ«Õâ¸öÒ³ÃæÉϵÄÊý¾Ý¸úshowUser.js ......
<!--
/* 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µÄÈÕÆÚÎÊÌ⣬ͨ³£ÐèÒª°´ÒªÇóÉú³ÉÈÕÆÚµÄ»°£¬Í¨³£»áÓõ½util°üÖеÄCalendarÀ࣬ÔÙÓÃCalendarµÄgetTime()·½·¨Éú³É¶ÔÓ¦µÄDate£¬×îºóÓÃSimpleDateFormatÊä³ö¡£
1. »ñÈ¡µ±ÆÚÈÕÆÚ¡¢Äê·Ý¡¢Ô·Ý
import java.util.Calendar;
public clas ......
JAVA String¶ÔÏóºÍ×Ö·û´®³£Á¿µÄ¹ØÏµ½âÎö
1 ×Ö·û´®ÄÚ²¿Áбí
JAVAÖÐËùÓеĶÔÏó¶¼´æ·ÅÔÚ¶ÑÀïÃæ£¬°üÀ¨String¶ÔÏó¡£×Ö·û´®³£Á¿±£´æÔÚJAVAµÄ.classÎļþµÄ³£Á¿³ØÖУ¬ÔÚ±àÒëÆÚ¾ÍÈ·¶¨ºÃÁË¡£
ÐéÄâ»úΪÿ¸ö±»×°ÔصÄÀàÐÍά»¤Ò»¸ö³£Á¿³Ø¡£³£Á¿³Ø¾ÍÊǸÃÀàÐÍËùÓó£Á¿µÄÒ»¸öÓÐÐò¼¯ºÏ£¬°üÀ¨Ö±½Ó³£Á¿(string¡¢integerºÍfloat point³ ......