Author | Message |
---|---|
dliang
Posts: 35
|
Posted 23:15 May 09, 2019 |
Is this correct? java MyProgram -Help |
wcwir
Posts: 75
|
Posted 23:34 May 09, 2019 |
Not quite: These three lines are correct:
They need to go inside your main method. (And of course you need to implement the printHelp() method.) The class itself you write as usual: public class MyProgram {
And then when you run your program from the command line, you can run it either like you always do:
or like this:
For more on command-line arguments see section 7.13 of the textbook. Last edited by wcwir at
23:35 May 09, 2019.
|