Originally posted by Urs Waefler:
Now I have that code:
The above code should not give warning concerning h as far as I can tell(and if, it will state that h
might not be initialized).
What I would do, if I were you - would be to solve the problem in small steps. For example, instead of initializing h with:
Integer.parseInt just do something like: int
h=10;
A variable, like h, lives - which means, that it is visible -in a scope. You can see a scope as the space between a { and the end tag }.
In your code, h's scope is the main method.
does this help you?
/Svend Rost