Join Peggy Fisher for an in-depth discussion in this video Revisiting arrays, part of Learning Java.
- In the segment on data types,…we introduced the concept of arrays.…Now we will expand on this concept…and review a few more examples.…What if you wanted to write a program…to find the average height of all students in a classroom?…To make the program more flexible,…we will ask the user to enter…how many students are in the class ahead of time,…and then use that value as the size of the array.…After all heights have been entered,…we can use a loop to find the height of the tallest student…and the average height for all students in the class.…
Let's give it a try.…Since we're asking the user to enter the heights,…I need to add, on line seven, my import statement,…import Java.util.scanner.…Now I'll go ahead and create a scanner object on line 18.…Okay. The first thing I wanna do is,…find out how many students are in the class.…Let's declare some variables.…We know that you can't have half a student,…so the data type for the number of students…should be an int.…Next we wanna create an array that will hold…all of the students.…
- 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.