Join Peggy Fisher for an in-depth discussion in this video Comparing different types of loops, part of Up and Running with Java.
- When testing the programs we've written so far…we had to build and run the programs each time…with different input values.…It is not hard when we only have a few test cases…but what happens when we wanna test one hundred values…or maybe even a thousand?…Or better yet maybe we don't even know…how many times the program needs to run.…Fortunately, we have several ways to repeat…a block of code.…Java has three types of loops:…a do while, which is a post test loop,…a while loop, which is a pre-test loop,…and a for loop, which is also a pre-test loop.…
Each loop has a specific purpose.…The do while loop executes the block of code…at least once since it doesn't check the status…of the condition until after executing the code in the loop.…A while loop repeats as long as…a conditional statement is true…and a for loop executes a predetermined number of times.…Let's review the syntax for each of the loops included here.…I already have a program opened called Loops.…And I've created three loops.…Each loop does exactly the same thing.…
- 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.