Alternative Array Declaration Syntax Assignment Help

Assignment Help: >> Elements of Java - Alternative Array Declaration Syntax

Alternative Array Declaration Syntax

There is a second form which might be used to declare an array.

type [ ] var-name;

In the above declaration, the square brackets follow the type specifier not the name of the array variable. For instance, the following two declarations are equal.

int al[ ] = new int [3];

int [ ] a2 = new int [ 3];

The following declarations are also equal;

char twod1[ ] [ ] = new char [3] [4] ;

char [ ] [ ] twod2 = new char [3] [4];

This instead declaration form is involved mostly as a convenience.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd