True or False: in the following code, the variable
age is accessible where newAge is declared.
public class AgedJeroo
{
public void increase()
{
if (this.seesFlower(HERE))
{
int age = 0;
// ...
}
int newAge = age + 1;
}
}
False: since age is declared inside the if statement, its scope ends at the closing brace of the block where it is declared.
- True: since age is declared inside the method, it can be accessed anywhere inside the method.
- False: age cannot be accessed at that location because it is not a field.
- True: since age is declared as a field, it can be accessed anywhere inside the class.
There are no hints for this question