Java for Humans {Data Structures: Arrays}

Lincoln W Daniel
ModernNerd Code
Published in
8 min readJan 18, 2016

--

View Table of Contents | Download Supporting Code | Subscribe to ModernNerd Youtube Channel for Coding Videos | By Lincoln W Daniel

In your phone, you have a phone book filled with names and numbers of family and friends. The good thing about your phone book is it holds many contacts, but the bad is that it is limited, although you may not know it. Your phone book can only hold a predetermined number of contacts. You can add new contacts, update contacts, and delete contacts. With that said, your phone book is a data structure. More specifically, it is an array. We will learn how to make a phone book with an array in this chapter.

Why Arrays are Important & Useful

In the Variables chapter, you learned how to store a single data point in a variable. Then, in the Datatypes chapter, you learned that its best to store data of a certain type in a variable with that respective type: store a character string in a String variable, store a whole number, integer in an int variable, store a floating point number in a double variable, and so on. Now that we are becoming more advanced Java programmers, we want to store a collection of data in a single data structure for later manipulation.

Data Structures

A data structure is exactly what it sounds like — a structure that holds data. Unlike variables, which only hold a single point of data, data structures collect one or more points of data of the same type…

--

--

Lincoln W Daniel
ModernNerd Code

Chief Bull @ BullAcademy.org ® Elevating writers @ ManyStories.com. Author @JavaForHumans Ex: Editor in Chief MarkGrowth (acq.), Engineer @Medium @GoPuff