Topic: main函数的引数

  Print this page

1.main函数的引数 Copy to clipboard
Posted by: jiang_sl
Posted on: 2004-02-13 16:22

main(String[] args) args存储的是什么命令行引数?
这些引数有什么作用?
它的具体取值会是那些??
我经常在IO系统看到args.length 形式,它是代表什么意思,和IO操作有什么关系???

感谢大家的帮助~~~~~~~~~

2.Re:main函数的引数 [Re: jiang_sl] Copy to clipboard
Posted by: 独孤牧
Posted on: 2004-02-14 00:25

U'better finishTIJ first!

3.Re:main函数的引数 [Re: jiang_sl] Copy to clipboard
Posted by: newnewworm
Posted on: 2004-02-14 10:01

arg.length是的引数的长度
比如:java classa aa bb cc dd ee
有很多时候要把引入的参数和具体的程序分开,这样便于程序的运用。在Java Example中有很多这样的例子的!

4.Re:main函数的引数 [Re: jiang_sl] Copy to clipboard
Posted by: aska0865
Posted on: 2004-02-14 12:11

thats a array of Strings.
like old time, when you play with the dos command or linux shell, usually type in sth. like:

dir -p -s
ls -l

-p -s are Strings
the length is detemine how many arguments and
java HugeIntOpTest add 923434321 1123434321
The command line arguments provide the type of operation

5.Re:main函数的引数 [Re: jiang_sl] Copy to clipboard
Posted by: jiang_sl
Posted on: 2004-02-14 22:56

这些引数在实际开发中有什么运用呢??
是不是仅在调试程序时会用到??

6.Re:main函数的引数 [Re: jiang_sl] Copy to clipboard
Posted by: hitaco
Posted on: 2004-02-15 10:54

BTW: 什么叫引数?

7.Re:main函数的引数 [Re: jiang_sl] Copy to clipboard
Posted by: 独孤牧
Posted on: 2004-02-15 11:34

引数是在TIJ e/2 中侯捷对arguments的翻译

8.Re:main函数的引数 [Re: jiang_sl] Copy to clipboard
Posted by: kingwzb
Posted on: 2004-02-15 13:35

如果你运行这个java程序后加参数 arg1 arg2 agr3(用空白字符分开)
那么args就是包含arg1, arg2, arg3的字符串数组

9.Re:main函数的引数 [Re: jiang_sl] Copy to clipboard
Posted by: jiang_sl
Posted on: 2004-02-15 18:40

这样做在实际工程中有什么用尼???
我的工程没可能会在运行时加引数呀?????

10.Re:main函数的引数 [Re: jiang_sl] Copy to clipboard
Posted by: hotyaya
Posted on: 2004-02-15 21:09

你可以不加参数的

11.Re:main函数的引数 [Re: 独孤牧] Copy to clipboard
Posted by: hitaco
Posted on: 2004-02-17 22:46

受不了

独孤牧 wrote:
引数是在TIJ e/2 中侯捷对arguments的翻译


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923