title: The method ____ is undefined for the type ____
body: <p>Okay so I have a homework assignment and I'm having difficulty calling a method on my main class that is in another class. </p>
  
  <p>Basically the "test" method is in the landEnclosure.java class and I'm trying to call it on my main class which is landAndEat.java</p>
  
  <p>They're both inside the same package:</p>
  
  <p><a href="http://i.stack.imgur.com/bmW2o.png" rel="nofollow">Image</a></p>
  
  <p>This is the main class where I'm trying to call the  method:</p>
  
  <pre><code>public class landAndEat {
      public static void main(String[] args) {
          test();
  
      } //end class
  
  } //end main
  </code></pre>
  
  <p>This is the class where the method is being created: </p>
  
  <pre><code>import java.util.Scanner;
  
  public class landEnclosure {
      public void test() {
          double area, ratioA = 0, ratioB = 0, x, l, w, perimeter;
          Scanner input = new Scanner(System.in);
  
          System.out.println("What area do you need for your enclosure in square feet?");
          area = input.nextDouble(); 
  
          if( area &gt; 0 &amp;&amp; area &lt;= 1000000000) { //Input specification 1
              System.out.println("What is the ratio of the length to the width of your enclosure?");
                  ratioA = input.nextDouble();
                  ratioB = input.nextDouble();
          }
                  else
                      System.out.println("It needs to be a positive number less than or equal to 1,000,000,000!");
  
                  if(ratioA &gt; 0 &amp;&amp; ratioA &lt; 100 &amp;&amp; ratioB &gt; 0 &amp;&amp; ratioB &lt; 100) { //Input specification 2
                      x = Math.sqrt(area/(ratioA*ratioB));
                      l = ratioA * x;
                      w = ratioB * x;
                      perimeter = (2 * l) + (2* w);
  
                      System.out.println("Your enclosure has dimensions");
                      System.out.printf("%.2f feet by %.2f feet.\n", l, w);
                      System.out.println("You will need " + perimeter + " feet of fence total");
                  } 
                  else
                      System.out.println("The ratio needs to be a positive number!");
  
  
      }
  
      } //end class
  </code></pre>