Error with methods and while loop in java
<p>I have problem with "compareMethod" and with the while loop, so if anyone has any idead how to help me i would be grateful thank you. I am using Eclipse as an Ide.</p>

<p>I want to enter three values and then to print the smallest one.</p>

<p>Here is my code:</p>

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

public class CompareValues
{
public static void main( String[] args )
{
    System.out.println();
    System.out.println( "The smallest number is: " );
    int first;
    int second;
    int third;
    checkMethod( first, second, third );
}

static int checkMethod( int firstNumber, int secondNumber, int thirdNumber )
{
    Scanner input = new Scanner( System.in );
    System.out.println( "Enter three nubmers between 1 - 100: " );
    firstNumber = input.nextInt();
    secondNumber = input.nextInt();
    thirdNumber = input.nextInt();

    if ( ( 0 &lt; firstNumber ) || secondNumber || ( thirdNumber &gt; 100 ) )
    {
        System.out.println( "Invalid entry: enter numbers between 1 and 100 only: " );
    }
}

static int compareMethod( int first, int second, int third )
{
    if ( ( first &lt; second ) &amp;&amp; ( first &lt; third ) )
    {
        return first;
    }
    else if ( ( second &lt; first ) &amp;&amp; ( second &lt; third ) )
    {
        return second;
    }
    else
    {
        return third;
    }
}
}
</code></pre>

<p>When I compiled the code I got this message:</p>

<blockquote>
  <p>Exception in thread "main" java.lang.Error: Unresolved compilation problems: The local variable first may not have been initialized The local variable second may not have been initialized The local variable third may not have been initialized at CompareValues.main(CompareValues.java:11) </p>
</blockquote>
