What does this line of code do?
String usage = "IndexHTML [-create] [-index <index>] <root_directory>";
开发者_运维知识库
What does this line do in my IndexHTML.java
file?
It defines either a local variable or a field (depending on its location) named usage
of type String
with the value "IndexHTML [-create] [-index <index>] <root_directory>"
.
It looks like it's meant for a short error/help message about how to run the class. It means that the class (when started from the command line) takes an optional -create
flag, an optional -index
option with an argument and that you need to specify the root directory.
If you search around you will find also an if checking the contents and size of your args array.
精彩评论