Privacy Policy Terms Of Use. Copyright © 2006-2010 Java Tutorials and Examples.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Once created, array elements can be initialized explicitly using loop or initialization can be combined with the array creation using following syntax.
<type>[] arrayName = { <initialization value list>};
Following is the example of the same.
int [] myIntArray = {1,2,3,4};
Note: initialization list can be legally terminated by comma. For example
int [] myIntArray = {1,2,3,4,};
<< Array Creation Accessing Array Elements >>

Post new comment