When do variables come into scope
from when they are first defined
when do variables lose scope
when the statement block they were defined in ends, closing curly bracket
using a variable after the block it was defined in results in
an error ‘cannot be resolved’
how to keep a variable after a loop or if statement
declare the variable beforehadn
can variables in scope be redefined
no
when do variables defined in initialisation of for loop lose scope
when for loop completes
when do variables inside for loops lose scope
at each iteration of the for loop