Consider the class ScopeTest defined this way:
public class ScopeTest { public double x; public void method(double newX) { if (newX>0) { double y = Math.sqrt(newX); //line1 } //line2 } //line3 }
In which place(s) can we add y = newX;?
a. Only in line1 In line1, line2, and line3
b. No where in the class;
c. a variable cannot be declared in an IF statement
d. In line1 and line2