Java Tutorial - Command Line Arguments

preview_player
Показать описание
Command Line Arguments in Java

This is a short and simple video tutorial to illustrate how to use and process command line parameters in Java. It covers all of the basics necessary to get you started with command line parameters and using them in a practical way. In particular, I will illustrate the answers to the following five questions:

Q1- What exactly is a command line parameter (or command line argument)?

Q2- How to determine if any command line parameters were passed to the program?

Q3- If so, how many command line parameters were received by the program?

Q4- How to identify and process each individual parameter when given an arbitrary number of parameters?

Q5- This is a questions that most beginners struggle with - how to read in and process a non-string parameter, such as an integer?

As always, I hope you enjoy the video and find it useful. Please leave any questions or feedback you may have in the comments section and I will get back to you. Thank you!

WATCH SOME MORE JAVA TUTORIALS

Enhanced For Loop Explained and Illustrated

For Loops Explained and Common Pitfalls Highlighted

How to use the Shortcut Operators

How to use the Conditional Operator ( ? : )

Compare Objects - Equality Operator Vs Equals Method

Passing by Value (Object References)

How To Write A Method Part II

How To Write A Method Part I

Passing by Value (Primitive Data Types)

Division and Modulo Operators Explained

Operator Precedence Explained

What are Data Types, Variables and Constants?

How to use Nested If Statements

How to use simple If Statements

What are Control Flow Statements

How to Write, compile and run your first Java program on Windows

How to write, compile and run Java programs all within Notepad++

How to download and install the Notepad++ editor on Windows
Рекомендации по теме
Комментарии
Автор

Liked your approach, easy to follow thanks very useful

robellens
Автор

I am working on a college project and I need to specify the command.

let's say I want to pass arguments representing a population, a step size and amount of days.

i need to do it like java -jar program.jar -p 100 -s 0, 1 -d 30
where p represents population
s the step size
and d the amount of days

how do i do this?

ScorpionGamerPT