CS 1114 Lecture Notes - Lecture 11: Dont, Vtech, Local Variable

32 views2 pages

Document Summary

Homework: read chapter vii; see string methods on last slide of week vii notes. Test ii write a loop w/ list. Upcoming assignments: begin lab xi due f, 11/10 at 16:30; test ii is w, 11/15. Notes: scope refers to a region of program code where a name is visible; a name cannot be visible outside its scope (roughly, braces typically mark a scope). Local variables are only visible from its declaration until the closing brace enclosing it: example: variable2 is in a smaller scope than variable1. public void thismethod() int variable1 = ; while(notdone) int variable2 = ; References are stored in reference variables (such as fields, parameters, or local variables) that refer to objects (not primitive data int, double, char, etc. ). Primitive data values do not use reference variables. A reference variable may over time refer to different objects. Objects can be arbitrarily big: example: r1 = r2, example:

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