Question: For this question, we will revisit the main method. As you already know, the main method as to contain the argument String args[] . This
For this question, we will revisit the main method. As you already know, the main method as to contain the argument String args[]. This argument allows you to give data to you program as you start it. To do so, you need to pass the "command-line arguments" upon the invocation of your program like this:
>java MyProgram one two Where args now contains the strings "one" and "two". We can now use args like a regular array.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
