Ch 5: Java Arrays

About This Chapter

Study these Java tutorial lessons to learn about about arrays in Java. These simple and engaging lessons help you understand what arrays are and differentiate between the array types.

Java Arrays: Chapter Summary

This Java tutorial chapter contains bite-sized lessons that cover the essentials of arrays in the Java programming language. You'll learn what an array in Java is and take a look at different types of arrays. The chapter also covers array lengths, conversion and addition.

The chapter is taught by expert Java instructors who break down array concepts into simple definitions and easy-to-understand examples. This way, you can be sure you learn key Java topics quickly and efficiently. Lesson quizzes are included to help you check your understanding of the material.

This chapter goes over the following topics:

  • Defining and initializing an array in Java
  • Array lengths
  • Converting a string to byte array
  • Multidimensional, dynamic and associative arrays
  • Adding to arrays

Java is a trademark of the Oracle Corporation, which is not affiliated with

8 Lessons in Chapter 5: Java Arrays
Test your knowledge with a 30-question chapter practice test
What is an Array in Java?

1. What is an Array in Java?

Another complicated-sounding programming concept that is straightforward and powerful: The array is a sequence or list of values. In this lesson we will define Java arrays and provide real-world examples of their use.

Java: Initializing an Array

2. Java: Initializing an Array

Arrays in Java are powerful tools in which you can store multiple elements within one object. But how do you initialize them? This lesson provides an overview and code examples for the use of arrays.

Array Lengths in Java

3. Array Lengths in Java

You'll learn how Java represents and stores arrays of data, how to access array elements and determine the number of elements (i.e., the length) of an array.

Java: Convert String to Byte Array

4. Java: Convert String to Byte Array

Getting a string into byte-sized chunks can be a handy way to work with text data in Java. This lesson will define the concept and provide working code examples for the best way to go about doing this.

Java: Multidimensional Arrays

5. Java: Multidimensional Arrays

We are entering multiple dimensions: multiple dimensions in Java arrays, that is. A multidimensional array is a nested array; an array within an array.

Java: Dynamic Arrays

6. Java: Dynamic Arrays

Technically, Java doesn't support dynamic arrays. But in this lesson, we'll learn some alternative strategies for achieving a similar functionality and result.

Java: Associative Arrays

7. Java: Associative Arrays

It's maps to the rescue! Java doesn't technically support an associative array, but Java does provide a Map class for that purpose. This lesson will define the concept and provide working code examples for working with this powerful approach to arrays.

Adding to Arrays in Java

8. Adding to Arrays in Java

An array is a great tool for storing multiple values in a single object. However, they are not practical if you cannot add values to them. This lesson covers adding values to arrays and provides working code examples.

Chapter Practice Exam
Test your knowledge of this chapter with a 30 question practice chapter exam.
Not Taken
Practice Final Exam
Test your knowledge of the entire course with a 50 question practice final exam.
Not Taken

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.