title: (JAVA) Why do I need to put com.company at the start of my program and how does this code work?
body: <p>So basically, I am a beginner to Java, and I am taking a course. Firstly, I don't understand why I need com.company at the beginning of this program (using IntelliJ IDEA and JDK 9.0.1). Secondly, I don't understand how this program calls the "calculateTax" method because the only method call is when the double variable "total" is being initialized. Here's the code:</p>
  
  <pre><code>package com.company;
  
  public class Main {
  
      public static double subtotal;
  
      // main function of the program
      public static void main(String[] args) {
          subtotal = 15.00;
          System.out.println("Subtotal: " + subtotal);
          double total = subtotal + calculateTax(0.08, subtotal);
          System.out.println("Total: " + total);
      }
  
      public static double calculateTax(double taxRate, double amountToTax) {
          double tax = amountToTax * taxRate;
          System.out.println("Tax: " + tax);
          return tax;
      }
  }
  </code></pre>
  
  <p>Here's the output:</p>
  
  <blockquote>
    <p>Subtotal: 15.0<br>
    Tax: 1.2<br>
    Total: 16.2  </p>
    
    <p>Process finished with exit code 0</p>
  </blockquote>
  
  <p>Thanks in advance :)</p>