Square number math method not working (Default constructor cannot handle exception type)
<p>The goal of my program is to ask the user to input a number, then use the custom method created to square that number and output the square. However, the problem arose when trying this. Please note this is my first program with using user inputted methods (Complete beginner at them)</p>

<p>error code</p>

<blockquote>
  <p>Error: Default constructor cannot handle exception type
  <code>java.io.IOException</code> thrown by implicit super constructor. Must
  define an explicit constructor</p>
</blockquote>

<p>Code:</p>

<pre><code>import java.io.*;

public class Squareit 
{
    BufferedReader myInput=new BufferedReader(new InputStreamReader(System.in));
    {
        String input;
        int num;
        System.out.println("1-12");
        input = myInput.readLine();
        num = Integer.parseInt(input);
    }

    public void square(int num) 
    {
        int ans = (num * num);
        System.out.println(" is" + ans);
    }

    public static void main(String[] args) throws IOException 
    {
        Squareit t = new Squareit();
        t.square(0);
    }
}
</code></pre>
