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 - Java Tutorial
From the course: Learning Java 11
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Mapping out program control flow3m 57s
-
(Locked)
Operators in Java2m 26s
-
(Locked)
Decision-making with if in Java4m 8s
-
(Locked)
Understanding scope in Java1m 39s
-
(Locked)
While loops (conceptually)1m 53s
-
(Locked)
While loops in Java3m 19s
-
(Locked)
Challenge: Multiple choice2m 22s
-
(Locked)
Sample solution: Multiple choice5m 1s
-
(Locked)
-
-
-
-