JavaÖжÁдÎļþ´óÈ«
http://hi.baidu.com/0_net/blog/item/8566fc2bb730c293033bf63e.html
Ò».»ñµÃ¿ØÖÆÌ¨Óû§ÊäÈëµÄÐÅÏ¢
/** *//**»ñµÃ¿ØÖÆÌ¨Óû§ÊäÈëµÄÐÅÏ¢
* @return
* @throws IOException
*/
public String getInputMessage() throws IOException...{
System.out.println("ÇëÊäÈëÄúµÄÃüÁî¡Ã");
byte buffer[]=new byte[1024];
int count=System.in.read(buffer);
char[] ch=new char[count-2];//×îºóÁ½Î»Îª½áÊø·û£¬É¾È¥²»Òª
for(int i=0;i<count-2;i++)
ch[i]=(char)buffer[i];
String str=new String(ch);
return str;
}
¿ÉÒÔ·µ»ØÓû§ÊäÈëµÄÐÅÏ¢£¬²»×ãÖ®´¦ÔÚÓÚ²»Ö§³ÖÖÐÎÄÊäÈ룬Óдý½øÒ»²½¸Ä½ø¡£
¶þ.¸´ÖÆÎļþ
1.ÒÔÎļþÁ÷µÄ·½Ê½¸´ÖÆÎļþ
/** *//**ÒÔÎļþÁ÷µÄ·½Ê½¸´ÖÆÎļþ
* @param src ÎļþԴĿ¼
* @param dest ÎļþÄ¿µÄĿ¼
* @throws IOException
*/
public void copyFile(String src,String dest) throws
IOException...{
FileInputStream in=new FileInputStream(src);
File file=new File(dest);
if(!file.exists())
file.createNewFile();
Fi
Ïà¹ØÎĵµ£º
Ò»¡¢Ê²Ã´ÊÇJSON
¡¡¡¡JSON ¼´ JavaScript Object Natation(Java¶ÔÏó±íʾ·¨)£¬ËüÊÇÒ»ÖÖÇáÁ¿¼¶µÄÊý¾Ý½»»»¸ñʽ£¬·Ç³£ÊʺÏÓÚ·þÎñÆ÷Óë JavaScript µÄ½»»¥¡£
¡¡¡¡¼ò¶øÑÔÖ®£¬JSON¾ÍÊÇJavaScript½»»»Êý¾ÝµÄÒ»ÖÖ¸ñʽ¡£Àý×ÓÈçÏ£º
{"username":"coolcooldool","password":"1230","usertype":"superadmin"}
{"list":[{"password": ......
java¿ª·¢µÄ³ÌÐòµÄ±£»¤
ÖÚËùÖÜÖª£¬javaΪ¿ª·¢ÓïÑÔÌṩÁ˺ܷ½±ãµÄ¿ª·¢Æ½Ì¨£¬µ«¿ª·¢³öÀ´µÄ³ÌÐòºÜÈÝÒ×ÔÚ²»Í¬µÄƽ̨ÉÏÃæ±»ÒÆÖ²£¬ÏÖÔÚÔ½À´Ô½¶àµÄÈËʹÓÃËü¿ª·¢Èí¼þ¡£
JavaÓÐËü·½±ãµÄÒ»¸ö·½Ã棬µ«ËüͬʱҲ´ø¸øÁË¿ª·¢ÕßÒ»¸ö·³ÄÕ£¬Õâ¾ÍÊDZ£»¤µÄ°ì·¨²»¶à£¬¶øÇÒ´ó¶àÊý²»ÊǺܺ ......
²Î¿¼´úÂë:
class SuperClass {
private int n;
SuperClass() {
System.out.println("SuperClass()");
}
SuperClass(int n) {
System.out.println("SuperClass(" + n + ")");
this.n = n;
}
}
class SubClass extends SuperClass {
private int n ......
try {
Runtime.getRuntime().exec("C:\\xxx.exe");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} ......
1. ActionFormÖÐÌí¼ÓÊôÐÔ£¬FormFileÀàÐͶÔÏó¡£
private FormFile upLoadFile;
public FormFile getUpLoadFile() {
return upLoadFile;
}
public void setUpLoadFile(FormFile upLoadFile) {
this.upLoadFile = upLoadFile;
}
2. Action ÖÐÔö¼ÓÐ޸ķ½·¨¡£
public ActionForward save(ActionMapping mapping, Action ......