JAVAÈçºÎµ÷ÓÃexe»òÕßÅú´¦ÀíÎļþ
/**
* JavaExec.java version 1.0 Feb 22, 2010
*/
import java.lang.Runtime;
import java.lang.Process;
import java.io.InputStreamReader;
import java.lang.Exception;
import java.io.*;
public class JavaExec {
/**
* @param args
* @author Eric Yang
* @
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
JavaExec javaExec = new JavaExec();
javaExec.testProcess();
}
public void testProcess()
{
try
{
String home="c:/process";
String command = "bfimport.bat -U yq -P qq -x bfimport_71.xml -p";
String[] cmd = new String[] { "cmd.exe", " ", "bfimport.bat" };
File dir = new File(home);
//Process process = Runtime.getRuntime().exec(command,null, dir);
Process process = Runtime.getRuntime().exec(command);
/*TestInputStream errorStream = new TestInputStream(process
.getErrorStream());
errorStream.start();*/
InputStream inputStream = process.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
String line = null;
while ((line = reader.readLine()) != null) {
System.out.println(line);
}
//int exitValue = process.waitFor();
//System.out.println("Return Value:" + exitValue);
process.getOutputStream().close();
}
catch(IOException e)
{
System.out.println("IOException ");
ÐÞ¸ÄÆäÖеÄcommand¾Í¿ÉÒÔÁË
ÉÏÃæµÄÀý×Óȷʵ¿ÉÒÔ»ñµÃһЩÊä³ö£¬µ«ÊÇÓкܶàÇé¿öÒ²ÎÞ·¨»ñÈ¡£¬Ôٲο¼ºÜ¶àʵÀýÖ®ºó£¬ÏÂÃæµÄÀý×Ó×îÇ¿´ó£¬¼¸ºõ¿ÉÒÔ²¶»ñËùÓÐÀàÐ͵ÄÃüÁîÐÐÊä³ö¡£
/**
* JavaExec.java version 1.0 Feb 22, 2010
*/
import java.lang.Runtime;
import java.lang.Process;
import java.io.InputStreamReader;
import java.lang.Exception;
Ïà¹ØÎĵµ£º
ÔÚJAVAÖУ¬ ÔÚʹÓÃString.split·½·¨·Ö¸ô×Ö·û´®Ê±£¬µ«Òª×¢ÒâÓÐЩ×Ö·û²»ÄÜÖ±½ÓÓõÄ,·Ö¸ô·ûÈç¹ûÓõ½Ò»Ð©ÌØÊâ×Ö·û,±ÈÈç "| "
,"*",µÈ·ñÔò»á³öÏÖÎÊÌ⣬ÒÔÇ°¸ÕÓÃʱ¾ÍÒòΪÕâ¸öÎÊÌâ¶ø¿´ÁË°ëÌìµÄ´úÂë¡£
public String[] split(String regex)
Splits this string around matches of the given regular expression.
&nbs ......
Íæ¹ýPSPµÄÅóÓÑÃÇ£¬Ïë±Ø¶¼Ìý˵¹ý¡¶ÓÂÕß30¡·µÄ´óÃû°É£¿àÅ£¬Ã»´í£¬ÎÒ˵µÄ¾ÍÊÇÄÇ¿î±ØÐëÔÚ30ÃëÄÚͨ¹ØµÄ±ä̬ÓÎÏ·¡£
´Ó±íÃæÉÏ¿´£¬¡¶ÓÂÕß30¡·µÄÓÎϷģʽÔÙ¼òµ¥²»¹ý£¬ÎÞ·ÇÊÇ´«Í³µÄRPGÓÎÏ·ÄÇÑù´ò¹Ö¡¢Á·¼¶¡¢Íê³ÉÖ§ÏßÈÎÎñ¡¢ÌáÉý×°±¸¡¢Ì½ÏÕ¡¢ÏûÃðħÍõ½áÊøÓÎÏ·¡£µ«ÊÇ£¬ËùÓÐÊܹýÆ䶾º¦µÄÅóÓѶ¼Çå³þ£¬ÕâЩҲ½ö½öÊDZíÃæÏÖÏó°ÕÁË¡£
ÒòΪÕâËù ......
½ñÌìÔÚÊýÖµ¼ÆËãʱÅöµ½Ò»¸öÎÊÌâ.³ÌÐòÈçÏÂ:
double a = (3.3-2.4)/0.1;
System.out.println(a);
Äã¿ÉÄÜÈÏΪ½á¹ûºÜ¼òµ¥,²»¾ÍÊÇ9Âï,ÊÇÊÂʵÉÏ,½á¹ûΪ:8.999999998,ΪʲôÄØ?ÎÒ·ÔÄÁËһЩ×ÊÁÏ,ÖÕÓÚÕÒ³öÁËÔÒò.
Ϊʲô¸¡µãÊý»á¶ªÊ§¾«¶È£¿
Ê®½øÖÆÊýµÄ¶þ½øÖƱíʾ¿ÉÄܲ»¹»¾«È·
¸¡µãÊý»òÊÇË«¾«¶È¸¡µ ......
ÏßÐÔ±í£¬Á´±í£¬¹þÏ£±íÊdz£ÓõÄÊý¾Ý½á¹¹£¬ÔÚ½øÐÐJava¿ª·¢Ê±£¬JDKÒѾΪÎÒÃÇÌṩÁËһϵÁÐÏàÓ¦µÄÀàÀ´ÊµÏÖ»ù±¾µÄÊý¾Ý½á¹¹¡£ÕâЩÀà¾ùÔÚjava.util°üÖС£±¾ÎÄÊÔͼͨ¹ý¼òµ¥µÄÃèÊö£¬Ïò¶ÁÕß²ûÊö¸÷¸öÀàµÄ×÷ÓÃÒÔ¼°ÈçºÎÕýȷʹÓÃÕâЩÀà¡£
Collection
©ÀList
©¦©ÀLinkedList
©¦©ÀArrayList
©¦©¸Vector
©¦¡¡©¸Stack
©¸Set
M ......