Arrays in Java for beginners

Arrays are a powerful tool in any programming language. In this Unit we are going to cover unidimensional and multidimensional arrays in Java.

Arrays in Java: Hello World example
Array’s Hello World example

The general term to refer to arrays is collections. During the lessons, you will see these terms interchangeable.

Lesson 1: Collections in Java: Unidimensional arrays

Collections is a very important topic in programming. Almost every code you will write will use collections in one way or another. In this article, you will learn what a collection is and how to use it in Java.

There is a general term widely used in the programmer’s community to refers to a collection: arrays. This happens because arrays are probably the most used type of collection. However, there are other types of collections, that is why I prefer to use the general term: collection.

So, what is a collection?

Lesson 2: Collections in Java: Multidimensional arrays

In the last lesson, we studied collections and specifically, unidimensional arrays in Java. In this lesson, we are going to study another important type of collection: multidimensional arrays.

Imagine we must create a program to represent a matrix. A matrix in mathematics, is a rectangular array or table of numbers, symbols, or expressions. In this example, we will consider only a matrix of integer numbers. The other type of elements can be represented in the same way, by changing the type of data that is stored.

Lesson 3: Unidimensional arrays problems and solutions

Arrays are very important in programming. Because of that, I’ll show you problems and solutions that require the use of arrays.

In this lesson you will learn how to solve the following two problems:

  • Problem 1: Lenovo Company
  • Problem 2: HR Department