Answer the question
In order to leave comments, you need to log in
Why does not see the variable [c]?
public static void main(String[] args) {
int k, c, j, a, b, d;
j = 10;
b = 2000;
k = 3000;
d = 4000;
a = 1;
if (j < 100) {
if (j < 90)
a = b;
if (k > j)
c = k - j;
} else
c = d;
System.out.println(a);
System.out.println(c);
System.out.println(k);
}
}
Answer the question
In order to leave comments, you need to log in
If j is less than 100 and k is less than j, nothing is assigned to c, so it may be uninitialized at the point of use.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question