From what I understand: Local (method) variables can be declared anywhere in code of method. They are then available for rest of method.
Question is: If local variable is declared within try/catch exception block is scope of this variable only within try/catch block or entire method from then on?
Vicken Karaoghlanian
Ranch Hand
Joined: Jul 21, 2003
Posts: 522
posted
0
You can refer to (�14.4.2) for more information about the scope of local variables.
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. <br />- What truth? <br />- That there is no spoon!!!
Babar Qadri
Ranch Hand
Joined: Oct 12, 2004
Posts: 51
posted
0
Only within try/catch block. And refer the link given by Vicken. cheers.
babar
Mike Gershman
Ranch Hand
Joined: Mar 13, 2004
Posts: 1272
posted
0
The key word is block.
Variables declared within a block { ... } are only known within that block. The individual try, catch, and finally blocks are examples of this.