Sunday, September 27, 2015

Array

  • An array is a group of like-typed variables that are referred to by a common name. Arrays of any type can be created and may have one or more dimensions.
  • A specific element in an array is accessed by its index. Arrays offer a convenient means of grouping related information.
  • An array type is a special reference type that signifies an array, a region of memory that stores values in equal-size and contiguous slots, which are commonly referred to as elements.
  • This type consists of the element type (a primitive type or a user-defined type) and one or more pairs of square brackets that indicate the number of dimensions (extents).
  • A single pair of brackets signifies a one-dimensional array (a vector), two pairs of brackets signify a two-dimensional array (a table), three pairs of brackets signify a one-dimensional array of two-dimensional arrays (a vector of tables), and so on.
For example,
int[] signifies a one-dimensional array (with int as the element type), and double[][] signifies a two-dimensional array (with double as the element type).

No comments:

Post a Comment

If you have any query please comment here, Will get back to you :)