... Character element : inputArray) { 
43            System.out.printf("%s ", element);
44         }
45 
46         System.out.println();
47      }
48   }
Array integerArray contains: 1 2 3 4 5 6 
Array doubleArray contains: 1.1 2.2 3.3 4.4 5.5 6.6 7.7 
Array characterArray contains: H E L L O

Printing array elements using overloaded methods.

The program begins by declaring and initializing three arrays—six-element Integer array integerArray (line 7), seven-element Double array doubleArray (line 8) and five-element Character array characterArray (line 9). Then lines 11–16 display the contents of each array.

When the compiler encounters a method call, it attempts to locate a method declaration with the same name and with parameters that match the argument types in the call. In this example, ...

Get Java How to Program, Early Objects, 11th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.