CSCI 1111 Chapter Notes - Chapter 5: Ex-Gay Movement

45 views3 pages

Document Summary

A typical variable stores one data item, like the number 59 or the character "a: instead, sometimes a list of data items should be stored. An array is a special variable having one name, but storing a list of data items, with each item directly accessible: each item in an array is known as an element. A normal variable is like a truck, whereas an array variable is like a train. An array is an ordered list of items of a given data type. Each item in an array is called an element: array reference variable declaration - datatype[] identifier; The [] symbols, called brackets, indicate that the variable is an array reference: that array must be explicitly allocated by the program using the new operator, array allocation - identifier = new type[numelements]; For example, to define an array of 5 integers named myarray, a programmer can use the statement int[] myarray = new int[5];

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents