Lecture 9
2
Scope
•scope of a variable or method: where its unadorned name is visible to the program
•Usually: the block { … } where it’s declared
•Examples from HLine.java
–scope of all fields:                  lines 15-114
–scope of screen (line 100) : lines 100-113
–scope of length (line 25):    lines 25-29 
–scope of i           (line 41):    lines 41-43
•Scope of a method is the class it’s declared in
•public declaration does not change scope