import java.util.*;
import java.lang.*;
import java.io.*;

class Dog {
  public String name;
  public Dog (String name) {
    this.name = name;
  }
}

class Person {
  public String name;
  public Person (String name) {
    this.name = name;
  }
}

class Greeter {
    public static void greet (Person person) {
        System.out.println("Hello, " + person.name + "!");
    }
}

class Main {
    public static void main(String[] args) {
        
        Dog dog = new Dog("Fido");
        Person person = new Person("Fido");
        
        // System.out.println(dog == person); // error: incomparable types: Dog and Person
        System.out.println(dog.equals(person)); // false
        System.out.println(person.equals(dog)); // false
        
        Greeter.greet(person); // Hello, Fido!
        // Greeter.greet(dog); // error: incompatible types: Dog cannot be converted to Person
        
    }
}
Output
(Run the program to view its output)