2. Learning the Basics
Overview
In this chapter, we will be executing programs that do not have the typical linear flow that we have seen so far. You will first learn to use if, else, else if, and switch-case statements to control the flow of your programs. You will practice running for, while, and do-while loops in order to perform repetitive tasks in Java, and how to pass command-line arguments to modify how programs run. By the end of this chapter, you will be able to implement immutable, static (global) variables, alongside Java's variable type inference mechanism.