O'Reilly logo

Introducing Data Structures with Java by David Cousins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5

Array Data Structures

Array Data Structures Arrays

Contents

  • Arrays as simple structures
  • Some examples and uses
  • Creating arrays dynamically at runtime
5.1 INTRODUCTION

In Chapter 2, we discussed issues that arise if a list of items is represented using separate discrete variables. In this chapter, we see how arrays deal with these issues. We show how items are stored and manipulated as an array, and build a simple example application.

5.2 WHAT IS AN ARRAY?

Consider the eight integers that we touched on in Chapter 2, Section 2.4. It is not efficient to declare eight separate variables with discrete identifiers; instead, make the following declaration:

  int numbers[] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required