How to properly handle default variables values being incorrect
<p>This is probably a basic question, better explained through code:</p>

<pre><code>    public void checkStatus {
        int status = UNKNOWN;
        if (somecondition) {
             status = STATUS_UP;
        } elseif (someothercondition) {
             status = STATUS_DOWN;
        }
    }
</code></pre>

<p>So the problem is, by definition I do not know all the possible conditions that might affect the STATUS, and I didn't want the compiler to throw 'my not be defined' error by not initializing the status local variable.</p>

<p>Bottom line my app won't work with a status set to UNKNOWN, I've just set it to shut up the compiler.</p>

<p>Question: how can I approach this elegantly, I've considered throwing an fatal exception at the end of the method should the status still be set to UNKNOWN, but that feels a bit 'ugly'. </p>

<p>Thank you.</p>
