Given:
What is the resulting output?
The myStr declared inside the try block shadows the instance field only within that block. It is parsed into myNum as 9009. Outside the block, the local variable is out of scope, so myStr refers to the instance field, which remains "7007".
myStr
try
myNum
9009
"7007"
Community Discussion