How do I get this variable to be global?
<p>The problem here is that I do not know where to define the variable <code>wage</code>, before its use in the if-else block to make it a field variable, so it can be recognized and used by Eclipse.</p>

<p>The code just below will give me the error at the last line of code: <code>wage</code> cannot be resolved to a variable. But when I place it in another line of code just under the Scanner console line (4 lines down from the top), it comes up with errors at all lines of code with the variable <code>wage</code> beneath it and says "duplicate local variable" So I do not know where to place it to make it a field variable. Any ideas anyone?</p>

<pre><code>import java.util.Scanner;

public class Java3 {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);
        System.out.println("*** Basic Wage Calculator ***");
        System.out.printf("%n");
        System.out.println("Enter start time in 24:00 format");
        String startTime = console.nextLine();
        String[] tokens = startTime.split(":");
        double starttimeHours = Double.parseDouble(tokens[0]);
        double startMinutes = Double.parseDouble(tokens[1]);
        if (starttimeHours &gt;= 6 &amp;&amp; starttimeHours &lt;= 8
                || starttimeHours &gt;= 9 &amp;&amp; starttimeHours &lt;= 19) {
            double wage = 1.6;
        } else if (starttimeHours &gt;= 9 &amp;&amp; starttimeHours &gt;= 10 &amp;&amp; startMinutes &gt;= 01) {
            double wage = 43;
        } else {
            double wage = 987;
        }
        System.out.println(wage);
    }
}
</code></pre>
