arrays creating an array as we noted in "overview,there are two kinds of data in javaprimitive types (such as int and doubleand objects in many programming languages (even object-oriented ones such as ++)arrays are primitive typesbut in java they're treated as objects accordinglyyou must use the new operator to create an arrayint[intarrayintarray new int[ ]/defines reference to an array /creates the arrayand /sets intarray to refer to it or you can use the equivalent single-statement approachint[intarray new int[ ]the [operator is the sign to the compiler we're naming an array object and not an ordinary variable you can also use an alternative syntax for this operatorplacing it after the name instead of the typeint intarray[new int[ ]/alternative syntax howeverplacing the [after the int makes it clear that the [is part of the typenot the name because an array is an objectits name--intarray in the preceding code--is reference to an arrayit' not the array itself the array is stored at an address elsewhere in memoryand intarray holds only this address arrays have length fieldwhich you can use to find the size (the number of elementsof an arrayint arraylength intarray length/find array size as in most programming languagesyou can' change the size of an array after it' been created accessing array elements array elements are accessed using an index number in square brackets this is similar to how other languages worktemp intarray[ ]intarray[ /get contents of fourth element of array /insert into the eighth cell remember that in javaas in and ++the first element is numbered so that the indices in an array of elements run from to