From the course: Learning Java 11

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Mapping out program control flow

Mapping out program control flow - Java Tutorial

From the course: Learning Java 11

Start my 1-month free trial

Mapping out program control flow

- [Instructor] In the last chapter, we've looked at how we can represent data in Java using data types and variables, as well as how to input and output data. In this chapter, we are going to add some decision-making logic, that will allow our programs to have different outcomes. We saw this a little bit in the last lesson, when we printed out whatever the user inputted, but we can create more sophisticated control flow, using conditions. Let's break this down. What is a control flow? A program's control flow is the order in which the program's instructions are executed. All of the programs we've looked at so far execute one statement after the other. We created a variable, then printed the variable. Or we created one variable and then another variable and then printed them both. Each line of code was executed sequentially. For example, line one is executed before line two, line two is executed before line three and so on. We can manipulate, which line of code is executed with special…

Contents