In this video, Doug Winnie shows how to create conditional tests using the if, else if and else statements. In addition, Doug introduces the Boolean variable type that can store values of true or false, and equality operators that compare two values and returns an evaluation of a Boolean true or false that can be used for a conditional test.
- [Instructor] Conditional tests are ways to code…to do different things based on evaluations…that return a Boolean value.…Boolean values can either be true or false,…and they are a special variable type in Java.…To create a Boolean value, you simply need to create…a new variable and make it a Boolean value type.…And then set it equal to true or false,…but note that you don't have to use…quotation marks around the words.…That would make it a string.…Let's create a Boolean value,…starting with boolean,…and we'll call it knowJava.…
We'll set it equal to true.…Then we'll create a console message.…System.out.println…The value of knowJava…is…knowJava.…Let's go ahead and run the code.…So that is the basics of working with a Boolean value.…Now conditional statements function based on Boolean values.…The if statement is the most basic conditional test.…To create an if statement,…start with the word if,…then create a pair of parentheses.…
Inside the parentheses, you need to provide…your Boolean value that needs to be tested.…
- The history of Java
- Setting up your development environment
- Working with values and variables
- Using methods and functions
- Capturing user input
- Creating conditional tests
- Using loops
- Creating and changing arrays
- Object-oriented programming in Java
- Defining permissions
- Extending classes
Skill Level Beginner
Computer Science Principles: The Internetwith Doug Winnie59m 30s Beginner
Java Essential Training for Studentswith Peggy Fisher3h 6m Intermediate
1. Intro to Java
2. Define Actions Using Code
3. Repeat Actions and Test for Conditions
4. Object-Oriented Programming Basics
Next steps1m 44s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
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.