title: The method is undefined for the type (object)
body: <p>I have three objects each with an individual integer assigned to them.</p>
  
  <pre><code>Food hamburger = new Food();
  hamburger.calories = 500;
  Food spaghetti = new Food();
  spaghetti.calories = 700;
  Food sausage = new Food();
  sausage.calories = 300;
  </code></pre>
  
  <p>And then a method to compare which food has the lowest calories.</p>
  
  <pre><code>public Food findLowestCalories(Food f1, Food f2, Food f3) {
  
      if (f1.calories &lt; f2.calories &amp;&amp; f1.calories &lt; f3.calories){
          return f1;
      } else if (f2.calories &lt; f1.calories &amp;&amp; f2.calories &lt; f3.calories){
          return f2;
      } else {
          return f3;
      }
  
  }
  </code></pre>
  
  <p>Then I have a line to print out the result of findLowestCalories:</p>
  
  <pre><code>System.out.println(findLowestCalories(hamburger, spaghetti, sausage));
  </code></pre>
  
  <p>I am getting an error: The method findLowestCalories(Food, Food, Food) is undefined for the type FoodEater.</p>
  
  <p>Any help would be greatly appreciated!</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>So FoodEater looks like this:</p>
  
  <p>public class Food Eater {</p>
  
  <pre><code>public static void main(String[] args) {
  
      Food hamburger = new Food();
      hamburger.calories = 500;
      Food spaghetti = new Food();
      spaghetti.calories = 700;
      Food sausage = new Food();
      sausage.calories = 300;
  
      System.out.println(findLowestCalories(hamburger, spaghetti, sausage));
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and my other class like this:</p>
  
  <pre><code>public class FoodMeasure {
  
  public Food findLowestCalories(Food f1, Food f2, Food f3) {
  
      if (f1.calories &lt; f2.calories &amp;&amp; f1.calories &lt; f3.calories){
          return f1;
      } else if (f2.calories &lt; f1.calories &amp;&amp; f2.calories &lt; f3.calories){
          return f2;
      } else {
          return f3;
      }
  
  }
  </code></pre>
  
  <p>}</p>