ITEC 1620 Lecture 13: 1620_lecture_13_slides

29 views32 pages

Document Summary

Value assignments objecta. value = 5; objectb. value = 7; j objecta. value =objectb. value; j objectb. value = 10; Value assignments ii objecta =objectb; objectb. value = 12; Assignment copies a value from one memory location to another. What are the memory locations, and what do they hold? y. Note the difference between copying values and copying references. Anint objectb = new anint(); objectb objecta j. Value assignments v objecta. value = 5; objectb. value = 7; objecta objectb j. Value assignments vi objecta. value =objectb. value; objectb. value = 10; objecta objectb j. Value assignments vii objecta =objectb; objectb. value = 12; objecta objectb j. What does objecta = objectb do? p. Copies contents in objectb"s memory y location into objecta"s memory location j. After objecta = objectb, both identifiers have references to the same object. Objecta and objectb are the same object. Any change to objecta is also a change. Any change to objectb is also a change to objectb to objecta.

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

Related Questions