Comments (1)
来自助教的优质解答!
用户参数是我定义的一个概念,我也没找到它的准确叫法。但是这个用户参数是有存在意义的。
选项是可以带参数也可以不带参数,比如-s就规定没有参数,这个时候arg0和-s没有任何关系。
并且参数的数量也是可以指定的,不一定只有一个,有相关的API可以做到这个事情。
选项如果带有N个参数,那么程序会默认把-*后面的N个字符串当成这个选项的参数,当然这些字符串不能带有“-”,否则会被认为是另一个选项。
用一个好理解的说法就是所有的选项指定了一些和程序相关的属性,而用户参数才是真正程序关注的东西
比如你要吃饭,选项可以更改你使用的餐具,但是用户参数指的是你吃什么,没有用户参数你显然无法完成吃饭这件事,但是你使用的什么餐具对整件事影响很小,它只是一个附带的属性
题目里只不过是没有处理用户参数,并不意味着所有的程序都不需要用户参数
getArgs获取的是全部用户参数
getOptionValue里需要传入某个选项的名字,然后回返回一个string数组,这就是这个选项的所有参数
from 2020se1-faq.
Related Issues (20)
- 本地出现这个NoClassDefFoundError,但是oj上可以通过 HOT 4
- 有关win10系统ZipFile中ZipEntry的getName()方法 (ZipFile中getEntry()同理) HOT 1
- AssertionError 不太懂哪里错了 怎么看,,,, HOT 1
- JVM02 HOT 2
- ClassFileReader本地全绿94ms通过所有测试,线上全部超时 HOT 17
- 关于filenotfound HOT 1
- 关于UTF8info中的getInstance方法 HOT 4
- 第二次大作业本地能过远端编译失败 HOT 9
- 大作业3报错:java:程序包org.apache.commons.lang3.tuple不存在 HOT 1
- 本地通过线上无法通过testCompositeSuccess HOT 7
- 【删掉classloader文件第17行import javafx.beans....... 】 HOT 1
- 关于大作业4Field类的constValueIndex变量
- 大作业5本地测试全部通过远端编译失败 HOT 1
- 大作业五本地过前三个用例 网站编译失败 HOT 6
- 大作业3 utf8info读取length为0,报错java.lang.UnsupportedOperationException: Invalid CP index 0 HOT 1
- 大作业6中,为要调用的方法创建新栈帧时的问题。 HOT 1
- 为调用的方法创建新栈帧时,局部变量表的问题 HOT 1
- 大作业Final在线修改后,本地pull发现测试的.class文件全部改变无法读取 HOT 2
- 大作业final,关于平台所有用例全部无法读取到类的问题
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 2020se1-faq.