COMP 202 Lecture Notes - Lecture 12: To Be Announced

39 views3 pages
jc123 and 40170 others unlocked
COMP 202 Full Course Notes
100
COMP 202 Full Course Notes
Verified Note
100 documents

Document Summary

Comp202 lecture 12 arrays and reference types. Office hours on tuesday october 17th 1:30 to 4:30pm. Arrays: a fixed number of values of the same type. Order they are stored matters. Arrays and strings are objects. In java, everything is an object, excluding the primitive data types. You can think of it as an address which points to where the data is located in memory. The address is what is stored inside the variable. Eg. int[] x = {1, 2, 3} int [] y =x; These statements create an array of three integers and make two different variables x and y, refer to it. Any change made by either variable will be seen by the other. Because x and y are different names for the same thing, they are sometimes called aliases. Once a string has been created it cannot be changed. The elements of an array can be updated anytime we want. Both arrays and strings are reference types.

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

Related Questions