Beginner Java - Static Error
<p>Good day!</p>

<p>I am a beginner in Java. I cannot compile the following code:</p>

<pre><code>public class Test {
 public static void main (String [] args ){
  int a = calcArea(7, 12);
  System.out.println(a);
 }

 int calcArea(int height, int width) {
  return height * width;
 }
}
</code></pre>

<p>The following error appears: </p>

<blockquote>
  <p><code>Non-static method calcArea(int, int) cannot be referenced from static content</code></p>
</blockquote>

<p>What does it mean? How can i resolve that issue..?</p>

<p>Your reply would be highly appreciated. 
Thank you</p>

<p>Based from your advice, I made an instance which is new test() as follows:</p>

<pre><code>public class Test {
    int num;
    public static void main (String [] args ){
        Test a = new Test();
        a.num = a.calcArea(7, 12);
        System.out.println(a.num);
    }

    int calcArea(int height, int width) {
            return height * width;
    }

}
</code></pre>

<p>Is this correct? What is the difference if I do this...</p>

<pre><code>public class Test {
 public static void main (String [] args ){
  int a = calcArea(7, 12);
  System.out.println(a);
 }

 static int calcArea(int height, int width) {
  return height * width;
 }
}
</code></pre>
