Ask Question
7 May, 20:05

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

+3
Answers (1)
  1. 7 May, 20:52
    0
    im working on this too but i think this is d
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Consider the class ScopeTest defined this way: public class ScopeTest { public double x; public void method (double newX) { if (newX>0) { ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers