Making the input read integer conversions and be totalled into an equation
<p>I have this code that takes a users input number and put it into an equation in the end. However, I keep getting an error/exception when compiling; 
"Error: variable convertToNumL might not have been initialized." I understand what the error is saying, however, I don't know how to debug this. </p>

<p>This is what I know, the try/catch block is somehow preventing the variable convertToNum (which is derived from the .readLine () method). Can anyone show me how to work around this? </p>

<p>Much appreciated.</p>

<p>Part of my code:</p>

<pre><code> if (realNumber2)
    {
      //Question 4: Height
      while (realNumber2 = true) {
        System.out.println ("3) Please enter the height of the triangle face.");


        try
        {
          stringTriangleHeight = myInput.readLine ();

          convertToNumH = Double.parseDouble (stringTriangleHeight);

          Integer.parseInt (stringTriangleHeight);

          System.out.println ("Your triangle height is " + stringTriangleHeight + " " + Units + ".");
          realNumber3 = true;

          break;
        }
        catch (Exception e)
        {
          System.out.println ("That was either a smart remark, a negative number or jibberish.");
          realNumber3 = true;
        }
      }
      while (realNumber3) {

      total1 = convertToNumL * convertToNumW;         //base area, length x width
      total2 = convertToNumL * convertToNumH / 2;     //triangle area using sidelength 'length', base x height / 2
      total3 = convertToNumW * convertToNumH / 2;     //triangle area using sidelength 'width  ,  base x height / 2
</code></pre>
