Problem compiling

Hello

I'm trying to compile a code i wrote but every time i try this error appears:

--Configuration: targil1task3 - JDK version 1.5.0_05 <Default> - <Default>--

C:\Program Files\Xinox Software\JCreatorV3LE\MyProjects\targil1task3\EquationsSystemStatistics.java:38: variable z might not have been initialized

if (z>1){// start of if 5

^

1 error

I don't understand the problem. In my code i defined "z" as:

"double z;"

and then one of 2 options:

"z=(double)((n-k)/(2*n)*(Math.pow(2,0.5)));"

or

"z=(double)((n+k)/(2*n)*(Math.pow(2,0.5)));"

By naming z's type double, i assume i'm not losing any of z's values (the n's + k's are integers).

I've tried everything, and need to hand this in tom. so anyone who thinks they might have an answer for me please write back!!!

thanx : )

[893 byte] By [yael_ta] at [2007-10-2 5:10:48]
# 1

It looks like somewhere in your code you have a statement like the following inside a method.int z;

Then you try to use the variable zif(z>1) ...

The compiler error is telling you that it is possible that z never gets any value. You need to explicitly set z to some value.

You might have some other code inside an if or inside a for loop, etc. that sets the variable z. Since this code is only run conditionally, the compiler can't tell that z gets set (even if you know it will be set).

atmguya at 2007-7-16 1:13:39 > top of Java-index,Developer Tools,Java Compiler...