Join Peggy Fisher for an in-depth discussion in this video Working with decisions, part of Up and Running with Java.
- View Offline
- Exercise Files
- When adding decision making logic in Java…the programmer often uses relational operators…to compare two values.…Some relational operators are…less than,…less than or equal to,…greater than,…and greater than or equal to.…We also have two equal signs,…which allows us to compare two values.…Remember that a single equal sign…represents an assignment,…that's when you're setting one value…to another value.…So we needed a way to say…are these two things equal?…And we use two equal signs.…
And finally, not equal.…You'll see in Java, and many programming languages,…we use the exclamation point…to indicate "not."…So in this case, we would read this as…not equal.…In addition, sometimes it's necessary to join…two or more statements.…This is done using logical operators.…We have the "and" operator,…which looks like this,…two ampersands.…And then we have the "or" operator,…which is two pipes.…In Java, we use the keyword "if"…and determine if it is true or false.…
We also have the keyword "else,"…which provides the statement or statements…
- Downloading and exploring NetBeans
- Understanding Java basics: data types, strings, arrays, and more
- Controlling flow with functions and loops
- Creating classes
- Sorting and searching arrays
- Manipulating files
- Handling errors
- Building GUIs
Skill Level Beginner
1. Getting Started
2. Java Basics
3. Flow of Control
4. Classes and Objects
5. Beyond the Basics
6. File Manipulation
7. Graphical User Interface Basics
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.