In this video, Doug Winnie shows how to create a for loop in Java. He also introduces the Math function that allows coders and developers to access common math, algebra, and trigonometry functions. Finally, Doug shows how to create nested loops and how to create escape characters for things such as a tab space.
- [Instructor] The for loop starts with the for statement,…and then you need to define the iterator,…conditional test, and the step increment,…for the iterator variable.…Let's create a for loop that will step through the numbers…of 0 through 24, and find the squares of each number.…First, we'll start with the for statement.…Then, we'll create a set of parentheses.…Inside, we first need to create our iterator variable,…which is often just called, i,…and we'll set that initially to 0.…We then add a semicolon.…Next, we take the iterator and we create a conditional test.…
This test must be true before it will attempt…to run through the code of the loop.…We then add another semicolon.…Last, we need to tell the loop how much we want…to change the iterator each time the loop runs.…We can use the increment operator…to increase it by 1 each time the loop runs.…Then we create a loop body by using curly braces.…Inside the code block, we will create…a message for the console log.…System.out.println.…We'll create a string that'll provide…
- 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?
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.