/*filename: WithParameter.java*/
//import java.io. *;
/**
* <p>Title: This follow is newman's writing</p>
* <p>Description: I want better writing ,instead of best one!</p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: Shu</p>
* @author Newman
* @version 1.0
*
* parameters: abc edf ghi jlm
*/
public class WithParameter { public WithParameter() {
}
public static void main(String[] args) {
WithParameter withparameter = new WithParameter();
int i=0;
while (i++<args.length) {
System.out.println("args["+(i-1)+"]= "+args[i-1]);
}
System.out.println("hello world!");
try {
System.in.read();
}
catch (Exception ex) {
System.err.println ("reading error: "+ex);
}
}
}/*
args[0]= abc
args[1]= edf
args[2]= ghi
args[3]= jlm
hello world!
*/--------------------------------------------
/*filename: run.bat*/E:\application\j2sdk1.4.0\bin\java.exe -classpath . WithParameter abc edf ghi jlm --------------------------------------------/*filename: compile.bat*/javac WithParameter.java -d .
//import java.io. *;
/**
* <p>Title: This follow is newman's writing</p>
* <p>Description: I want better writing ,instead of best one!</p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: Shu</p>
* @author Newman
* @version 1.0
*
* parameters: abc edf ghi jlm
*/
public class WithParameter { public WithParameter() {
}
public static void main(String[] args) {
WithParameter withparameter = new WithParameter();
int i=0;
while (i++<args.length) {
System.out.println("args["+(i-1)+"]= "+args[i-1]);
}
System.out.println("hello world!");
try {
System.in.read();
}
catch (Exception ex) {
System.err.println ("reading error: "+ex);
}
}
}/*
args[0]= abc
args[1]= edf
args[2]= ghi
args[3]= jlm
hello world!
*/--------------------------------------------
/*filename: run.bat*/E:\application\j2sdk1.4.0\bin\java.exe -classpath . WithParameter abc edf ghi jlm --------------------------------------------/*filename: compile.bat*/javac WithParameter.java -d .
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货