| Author |
Scope of vars in a static block
|
P Teng
Greenhorn
Joined: Nov 20, 2009
Posts: 16
|
|
Hi , a quick one please
The following code does not compile, complaining that it cannot find symbol : variable y.
Does this mean that variables in static or not static code blocks are limited in scope only to that block only if they have been declared there ?
|
 |
Patricia Samuel
Ranch Hand
Joined: Sep 12, 2007
Posts: 300
|
|
|
Exactly. y is local to that block and could not be accessed outside.
|
 |
 |
|
|
subject: Scope of vars in a static block
|
|
|