title: How do I call a method from another class in Java?
body: <p>here are my 3 classes: which are the main method, dog class and getFee class.</p>
  
  <p>Main method</p>
  
  <pre><code>package test;
  
  import java.util.Scanner;
  import pets.Dog;
  import Utilities.FeeCalculator;
  
  public class TestKennel 
  {
      public static void main(String[] args) 
      {   
          Scanner input = new Scanner(System.in);
  
          Dog dog = new Dog();
  
          System.out.println("Hello " + dog.name + ", who's a good dog?");
  
          dog.talk(); 
  
          FeeCalculator getFeeStatment = new FeeCalculator();
  
          getFeeStatement.getFee();
  
          input.close();
      }
  
  }
  </code></pre>
  
  <p>Dog Class</p>
  
  <pre><code>package pets;
  
  public class Dog 
  {
      public String name = "Fido";
      public byte age = 10;
      public void talk()
      {
          System.out.println("Woof Woof Woof!!!");
          System.out.println("I am " + age * 7 + " the equivalent of human years old.");
      }
  }
  </code></pre>
  
  <p>and finally the getFee Class</p>
  
  <pre><code>package Utilities;
  
  import pets.Dog;
  import java.util.Scanner;
  
  public class FeeCalculator 
  {
      double dailyRate;
  
      public String getFee(Dog dog, Scanner input)
      {
          System.out.println();
          System.out.println();
  
          System.out.println("What is the name of your pet?");
          dog.name = input.next();
  
          System.out.println("Input how many days your pet will be staying.");
          int numberOfDays = input.nextInt();
  
          String feeStatement = "The cost for boarding "
                                  + dog.name
                                  + " for "
                                  + numberOfDays
                                  + " days is $" + numberOfDays * dailyRate;
  
          return feeStatement;
      }
  }
  </code></pre>
  
  <p>at the main method part, why is eclipse giving me an error? isn't this how i call a method?:</p>
  
  <pre><code>FeeCalculator getFeeStatment = new FeeCalculator();
  
  getFeeStatement.getFee();
  </code></pre>
  
  <p>help will be really appreciated!</p>