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+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents