trying to print and get: "cannot be resolved to a variable" error
<p>I cannot understand why in the following code:</p>

<pre><code>System.out.println("Enter start time");
String startTime = console.nextLine();
String [] tokens = startTime.split(":");
double starttimeHours = Double.parseDouble(tokens[0]);
double pickupMinutes = Double.parseDouble(tokens[1]);{
 if (starttimeHours &gt;=6 &amp;&amp; starttimeHours &lt;=9 ){
 int peaktimeWage = 4;}
 else if  (starttimeHours &gt;=1 &amp;&amp; starttimeHours &lt;=5 ){
  int peaktimeWage = 2;}

else {int peaktimeFare = 3;}{
  System.out.println(peaktimeWage);
</code></pre>

<p>I keep getting the error " peaktimeWage cannot be resolved to a variable". At the last line of code which is:</p>

<pre><code>  System.out.println(peaktimeWage);          
</code></pre>

<p>Because it is a variable defined previously, and even says next to the variable up there that the variable is not used. I checked that I have written it in the same as previous code when printing out. So I do not know what the problem is. Anyone know?</p>
