- In our demo program…we did not pass any arguments to the main method.…There are times when the user needs to enter…command line arguments when invoking the application.…Let's create a new program to take in a message…and then echo back each string on a seperate line.…In the text editor brackets,…we will create a new program…and call it DemoWithArguments.java…and save it to our My Java folder on the C drive.…I want to go ahead and save this program…as DemoWithArguments.java…I'm gonna navigate to My Java folder…and I'm gonna click Save.…
We'll start by declaring the class,…public class DemoWithArguments.…Don't forget, this name has to be…the exact same name as the file name.…Okay, inside the class I'll add my main method,…public static void main.…And in the parentheses for the main…I'll have the argument, an array of strings,…and usually we give it the name A-R-G-S…to represent arguments.…
The code for my main method…is gonna be fairly simple.…I'm going to use an advanced for loop…to loop through all the values in the A-R-G-S array,…
- Getting started with parsing
- Reviewing data types
- Using decisions
- Creating user-defined methods
- Command-line debugging
- Exploring the Java API
- Creating and instantiating classes
- Working with interfaces
- Storing items with arrays
Skill Level Intermediate
Q: How can I make my debugger function like the author’s?
1. Command Level Programming
2. Basics Review
4. Java API
5. Simulations and Algorithm Analysis
6. Classes and Objects
7. More on Classes
8. Data Structures
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.