O'Reilly logo

Technical Java™: Developing Scientific and Engineering Applications by Grant Palmer

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

Chapter 13. Arrays

If you have done any scientific or engineering programming you are familiar with using arrays. In Java, as in every other programming language, arrays are used for storing data. If you solve a system of equations or create a computational grid you will be using arrays. Since Java is a C-based language, there are some similarities between Java and C arrays. Java array indices start at 0. An element of a Java array can be accessed using the element index surrounded by brackets, [].

There are some notable differences between Java and C arrays. Java arrays are objects. Memory for an array is allocated on the heap using the new keyword. Arrays implicitly extend from the Object class and can use Object class methods. Unlike other languages, ...

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