title: the method equals(object) in the type object is not applicable to the arguments
body: <p>I have a program where I must see if the two names entered are equal and get other information about the names(such as length, or get the initials). Everything else runs properly but the equals method. </p>
  
  <p>I get the error:
  the method equals(object) in the type object is not applicable to the arguments(Name, Name)</p>
  
  <p>and I cannot figure out how to resolve this error. Can someone please help me understand what the error means?</p>
  
  <p>Here is my class name with all the methods:</p>
  
  <pre><code>class Name {
  
      private String firstName;
      private String middleName;
      private String lastName;
  
      public Name(String first, String middle, String last) {
          firstName = first;
          middleName = middle;
          lastName = last;
      }
  
      public String getFirst() {
          return firstName;
      }
  
      public String getMiddle() {
          return middleName;
      }
  
      public String getLast() {
          return lastName;
      }
  
      public String firstMiddleLast() {
          return (firstName + " " + middleName + " " + lastName);
      }
  
      public String lastFirstMiddle() {
          return (lastName + ", " + firstName + " " + middleName);
      }
  
      public boolean equals(Object name, Object otherName) {
          (name.toString()).toUpperCase();
          (otherName.toString()).toUpperCase();
          if (name.equals(otherName))
              return true;
          else
              return false; 
      }
  
      public String initials() {
          String initials = (firstName.toUpperCase().substring(0, 1) + middleName.toUpperCase().substring(0, 1) + lastName.toUpperCase().substring(0, 1));
          return initials;
      }
  
      public int length() {
          String wholeName = (firstName + middleName + lastName);
          return wholeName.length();
      }
  
  }
  </code></pre>
  
  <p>Here is the other class that tests name. </p>
  
  <pre><code>import java.util.Scanner;
  
  public class TestName {
  
      public static void main(String[] args) {
  
          String first, middle, last;
          String firstOne, middleOne, lastOne;
  
          Scanner input = new Scanner(System.in);
  
          System.out.println("Name Program");
          System.out.println();
          System.out.println("Name of the first person...");
          System.out.println("Enter the first name: ");
          first = input.nextLine();
          System.out.println("Enter the middle name: ");
          middle = input.nextLine();
          System.out.println("Enter the last name: ");
          last = input.nextLine();
  
  
          Name name = new Name(first, middle, last);
  
          System.out.println("Name of the second person...");
          System.out.println("Enter the first name: ");
          firstOne = input.nextLine();
          System.out.println("Enter the middle name: ");
          middleOne = input.nextLine();
          System.out.println("Enter the last name: ");
          lastOne = input.nextLine();
  
          Name otherName = new Name(firstOne, middleOne, lastOne);
  
          System.out.println();
          System.out.println("Information about the first person: ");
          System.out.println("Full Name: " + name.firstMiddleLast());
          System.out.println("Last name first: " + name.lastFirstMiddle());
          System.out.println("Initials: " + name.initials());
          System.out.println("Name length: " + name.length());
  
          System.out.println();
          System.out.println("Information about the second person: ");
          System.out.println("Full Name: " + otherName.firstMiddleLast());
          System.out.println("Last name first: " + otherName.lastFirstMiddle());
          System.out.println("Initials: " + otherName.initials());
          System.out.println("Name length: " + otherName.length());
  
          if (equals(name, otherName))
              System.out.println("They are the same");
          else
              System.out.println("They are not the same");
      }
  }
  </code></pre>