Arrays

Author: Tatyana Milkina

What is an array? It is a special data structure available in almost every programming language that allows you to represent a group of similar objects using a single common name.

Imagine you run a shelter for stray animals that has five cats. You may not remember the name of each cat, but each one has a tag with a number that uniquely identifies it. You can think of this as an array named "cats" of size five. Note that indexing starts from zero — this is the convention in Java. Without the possibility to create arrays, you would have to declare five separate variables with different names, which is not very convenient.

Array example with cats

In Java, you can create arrays of any dimension — one-dimensional, two-dimensional, three-dimensional, and so on. In this lesson, we will explore all these options.

Курс 'Java для начинающих' на Udemy Курс 'Java для начинающих' на Udemy
  1. One-dimensional arrays
  2. Multidimensional Arrays
  3. Length of Arrays
  4. Method Arrays.toString()
  5. Method Arrays.deepToString()
  6. Method Arrays.sort()
  7. Method Arrays.binarySearch()
  8. Method System.arraycopy()
  9. Tasks
Comments