O'Reilly logo

Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition by Rolf W. Rasmussen, Khalid A. Mughal

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

3.21. Array Elements as Actual Parameters

Array elements, like other variables, can store values of primitive data types or references to objects. In the latter case it means they can also be arrays, that is, array of arrays (see Section 4.1, p. 104). If an array element is of a primitive data type, then its data value is passed, and if it is a reference to an object, then the reference value is passed.

Example 3.6. Array Elements as Primitive Data Values
 public class FindMinimum { public static void main(String[] args) { int[] dataSeq = {6,4,8,2,1}; int minValue = dataSeq[0]; for (int index = 1; index < dataSeq.length; ++index) minValue = minimum(minValue, dataSeq[index]); // (1) System.out.println("Minimum value: " + minValue); } public static ...

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